I am currently doing some work in cocos2d-x and am thinking about using their box2d implementation for things like collision detection (but not necessarily response), range detection, and other things like that, which are not strictly physics based.

Is it worth doing this? or would I be better off just writing a simple system that does checks based on location/size of my objects?


1 Answer 1


Seems like a decent idea to me; I've done a very similar thing in a few projects (although with different APIs).

If functionality and performance is acceptable, and it saves you from having to write all that boring collision detection code and focus instead on something that makes your game unique and cool, then I'd say go for it.

  • \$\begingroup\$ I would probably agree, only it may help you in the long run to implement the detection yourself. If your needs as simple as range detection, sphere collision and AABB's it may be worth the extra day of development. Plus, even if you use Box2D afterwards, you may have a better understanding of how it works. If you need complex detection and compount colliders though, I'd go for Box2D. \$\endgroup\$ Jun 17, 2011 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .