Really a basic question, but I am moving a sprite A with a physics body over another kind of sprites B having another physics body. I expect the collision callback oncontact to be called for these bodies. They have their respective category bitmasks set using setCategoryBitmask()
and also respectively have each other's categories set using setContactTestBitmask()
.
The collision works as long as I do not move sprite A. I assume the problem is that I move sprite A using cocos2d actions, and I need to do something else. But using cocos2d actions for scripting things like these look so much simpler to me than anything else I can think of.
- Move sprite A using physics calls. (looks like a lot of work, and it looks like it's hard to achieve exact scripting perfection)
- Do my own collision detection in update() instead. (looks like a bunch of work too, especially if the sprites are rotated etc)
Is there any other shortcut? Or did I miss something else?