Most of the examples (I’ve seen from CL) show this method of calling a collision listener:
[lua]
local function myCollision(self, event)
…
end
player.collision = myCollision
player:addEventListener(“collision”, player)
[/lua]
However, in my tests the following works, is more straight-forward, and uses less code:
[lua]
local function myCollision(event)
…
end
player:addEventListener(“collision”, myCollision)
[/lua]
Is there some advantage to the first method that I’m not seeing?
Jay