How do I start to implement a class for sprite collision?
As Eric pointed out, CGRectIntersectsRect is the method to test two bounding rects for overlapping. Use the boundingBox method of the CCNode classes to get the correct bounding box for each sprite (or other node).
See my answer here: Collision Detection in Cocos2d game?
I would look into b2ContactListener
You can do some searches on that, and you'll easily get some results
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With