local function onEm3Collision( event ) print( "onEm3Collision: " .. event.phase ) if ( event.phase == "began" ) then audio.play( sounds["splash"] ) -- TRIGGER THE EMITTERS em3.x = event.x em3.y = event.y Particles.StartEmitter("em3", true) elseif ( event.phase == "ended" ) then bg2:removeEventListener( "collision", onEm3Collision ) waitingForSplash = false end end
I was not previously using physics.setReportCollisionsInContentCoordinates( true ), as I was unaware it was necessary. The documentation merely states “The x and y position can be influenced by physics.getAverageCollisionPositions() and physics.setReportCollisionsInContentCoordinates().”
I don’t know what influenced means. For me, it seems to mean I get event.x and event.y coordinates that do not match what I would expect to be the global x/y coordinates when I set it to true and I get 0 when it is not there.
Maybe the fact that I am using scenes or DisplayGroups is affecting this in some way?