Hello, I do not completly understand the way you can detect collisions in Corona.
I have read this- http://developer.coronalabs.com/content/game-edition-collision-detection, but still have no clue.
local function onCollision( event ) if ( event.phase == "began" ) then print( "began: " .. event.object1.myName .. " & " .. event.object2.myName ) elseif ( event.phase == "ended" ) then print( "ended: " .. event.object1.myName .. " & " .. event.object2.myName ) end end Runtime:addEventListener( "collision", onCollision )
Here is an exaple code.
On line 1, what does ( event ) mean/do?
Also, I am making a game that when “player” collides with “prize”, score = score + 1.
How would I create a listener that is only activated when two specified objects (that I delcrare) casue a result.
Any basic tutorials are welcome!
–Regards