Sprite collision detection (cocos2d)
I am wrapping up this game I am writing using cocos2d.
However during testing, I found out the method I am using to detect collisions between my character's weapon and the incoming objects does not always work accurately.
Most of the times it is working fine, but sometimes, it gets off by a bit.
The weapon is a spear and the object can be any size or shape, does anyone know a good collision detection method?
P.S. a bit more information, I am using CGRectInteresctRect to determine whether the spear hit anything and I am breaking spear into many small rects. But since the spear is moving fast and scheduling interval is 0.02, sometimes it just does not detect correctly.
Last edited by TelTikky; 09-20-2011 at 08:23 AM.
|