4
\$\begingroup\$

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?

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\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\$ – Jonathan Connell Jun 17 '11 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.