I have this scene, I want when the earth collide with the blackhole an explosion sprite to be played.
So I wrote this:
local function onCollision( event ) if ( event.phase == "began" ) then if(event.object1.name =="blackholeSprite" or event.object2.name =="blackholeSprite") then explosionSprite.x=event.x explosionSprite.y=event.y explosionSprite:play() timer.performWithDelay( 1500, gameOver ) end end end
The problem is that the explosion does not occur where the ball and the blackhole collide event.x andevent.y . As you can see from the screenshot the explosion take place in the top-left corner. Any idea why this happens?