Note, if you want to not detect collisions all by themselves, you should filter collisions. This link. contains a helpful table and tutorial to help you determine the maskbits and categorybits. Another alternative is group indexing, which you can read more on the first link. at the end of the document.
But, from what i see on your code, your ceiling and floor might be exploding as well. is happening is that your collision function onCollision
is treating all objects the same. You would need to assign a name to your jet object jet.name = "jet"
, then, on your collision function check if the object really is the jet:
function onCollision(event)
if event.phase == "began" and "jet" == event.object1.name then
if jet.collided == false then
jet.collided = true
jet.bodyType = "static"
explode()
storyboard.gotoScene("restart", "fade", 400)
end
end
end
Note that you should also assign a name to all other physics objects, in case you would like to do something special with each body, and don't forget to reset jet.collided
once you restart your game, if it implements it.
Read more about collision detection on the Corona Docs.