How do I test for collisions in main.lua in corona sdk when the objects to test for are defined in another class?
I have an image in player class, and an image in enemy class. In main how do I detect if these images collide?
local function onGlobalCollision (event)
if ( event.phase == “began” ) then
print( "began: " … event.object1.myName … " & " … event.object2.myName )
end
end
Runtime:addEventListener( “collision”, onGlobalCollision )
[import]uid: 138547 topic_id: 25449 reply_id: 325449[/import]