BTW, this is one of many, many ways to write your wall maker:
local function createWalls( wallWidth ) local fullw = display.actualContentWidth local fullh = display.actualContentHeight local centerX = display.contentCenterX local centerY = display.contentCenterY local leftWall = display.newRect( centerX - fullw/2 + wallWidth/2, centerY, wallWidth, fullh ) local rightWall = display.newRect( centerX + fullw/2 - wallWidth/2, centerY, wallWidth, fullh ) local topWall = display.newRect( centerX, centerY - fullh/2 + wallWidth/2, fullw - 2 \* wallWidth, wallWidth ) local bottomWall = display.newRect( centerX, centerY + fullh/2 - wallWidth/2, fullw - 2 \* wallWidth, wallWidth ) physics.addBody( leftWall, "static", {bounce = 0.0, friction = 2} ) physics.addBody( rightWall, "static", {bounce = 0.0, friction = 2} ) physics.addBody( topWall, "static", {bounce = 0.0, friction = 2} ) physics.addBody( bottomWall, "static", {bounce = 0.0, friction = 2} ) end createWalls( 40 )