Hi all the other Collision are borking but not the Ceiling & Floor is there something wrong in my code ?
ceiling = display.newImage(“invisibleTile.png”)
ceiling:setReferencePoint(display.BottomLeftReferencePoint)
ceiling.x = 0
ceiling.y = -20
physics.addBody(ceiling, “static”, {density=.1, bounce=0.1, friction=.2})
ceiling.name = “theCeiling”
theFloor = display.newImage(“invisibleTile.png”)
theFloor:setReferencePoint(display.BottomLeftReferencePoint)
theFloor.x = 0
theFloor.y = 500
physics.addBody(theFloor, “static”, {density=.1, bounce=0.1, friction=.2})
ceiling.name = “theFloor”
local function onCollision(event)
if event.phase == “began” and gameIsActive == true then
local obj1 = event.object1;
local obj2 = event.object2;
if obj1.name == “jetplayer” then
if obj2.name == “BCloud1” then MinLife()
elseif obj2.name == “BCloud2” then pontsMin10()
elseif obj2.name == “BCloud3” then pontsMin20()
elseif obj2.name == “GCloud1” then pontsplus50()
elseif obj2.name == “theFloor” then explode()
elseif obj2.name == “theCeiling” then explode()
end
end