I have items dropping from the sky (like the crate example), and I have 3 sides of forcefields (left, right, bottom) so objects can’t leave the stage. Unfortunately, sometimes they bounce off the floor and up off the screen.
--@start creating boundaries
local leftBoundary = display.newRect(-100,0,150,display.contentHeight + 800)
local rightBoundary = display.newRect(display.contentWidth-50,0,150,display.contentHeight + 800)
physics.addBody(leftBoundary,'static')
physics.addBody(rightBoundary,'static')
leftBoundary.alpha = 0.01
rightBoundary.alpha = 0.01
local ground = display.newRect(0,725,display.contentWidth,168)
ground:setFillColor(255,255,255)
ground.alpha = 0.01
physics.addBody(ground,"static")
screen:insert(leftBoundary)
screen:insert(rightBoundary)
screen:insert(ground)
I tried to add a “roof”, but that prevented the items from dropping into the play area. So I tried adding 800 pix to the left and right walls height to prevent escape, but that didn’t work either. So I am looking for a real method to keep all game pieces in play without leaving. [import]uid: 132937 topic_id: 36215 reply_id: 336215[/import]