Search code examples
cocos2d-iphonegeometrybox2dcollision-detectioncgrect

How to create a collidable circle in cocos2d?


I have looked throughout the Internet and other questions on this site, but I can't seem to find the answer. What I want to ask is that is there some sort of simple way that I can create a circle, like a CGRect, and have a collision detection? Do I need something called Box2d to do it? Ive seen it everywhere but have no idea how to use it..

-Thanks


Solution

  • Here are 2 very good tutorials on collision detection. Box2D will simplify your task, because it's all implemented, but there are other ways to do it.

    http://www.metanetsoftware.com/technique/tutorialA.html

    http://www.metanetsoftware.com/technique/tutorialB.html