There are obviously collisions happening on the screen, but my postCollision function never gets called. I create objects like this:
local cat = Cat.new()
The Cat class:
--constructor
function new()
local obj = display.newImageRect("images/cat.png", 16, 16)
physics.addBody ( obj, "dynamic", {density = 1, friction = 1.0, bounce = 0.3} )
function obj:pCollision( obj, event )
print("collision") --this never gets printed
end
obj.postCollision = pCollision
obj:addEventListener( "postCollision", obj )
return obj
end
What am I missing? [import]uid: 52127 topic_id: 9443 reply_id: 309443[/import]