I have a left, right, top, and bottom border on my main screen. Then I have some objects dropping onto the screen and they bounce on the ground. Then one of the blocks bounces off the right side of the screen. I would rather the objects bounce and hit a static wall and stay on the screen but that’s not happening for the left and right borders. What is wrong with the coding?
[lua]borderBodyElement = { friction = 0.5, bounce=0.5 }
local borderBottom = display.newRect( 0, 320, 460, 20 )
borderBottom:setFillColor( 0, 0, 0, 0 )
physics.addBody( borderBottom, “static”, borderBodyElement )
localGroup:insert(borderBottom)
local borderLeft = display.newRect( 0, 20, 20, 460 )
borderLeft:setFillColor( 0, 0, 0, 0 )
physics.addBody( borderLeft, “static”, borderBodyElement )
localGroup:insert(borderLeft)
local borderRight = display.newRect( 319, 1, 0, 480 )
borderRight:setFillColor( 255, 255, 0, 0 )
physics.addBody( borderRight, “static”, borderBodyElement )
localGroup:insert(borderRight)[/lua] [import]uid: 72372 topic_id: 12909 reply_id: 312909[/import]