Cocos2d + Box2d or Chipmunk [closed]

谁说胖子不能爱 提交于 2019-12-20 08:24:43

问题


OK, im trying to make an iphone version of a game i made here http://scratch.mit.edu/projects/techy/781198 is box2d or chipmunk better and where are some tutorials for each one


回答1:


If you download the Cocos2d SDK, in the included project is a sample of Box2d and Chipmunk. Just open the Xcode project called "cocos2d-iphone" and look Box2dtest and Chipmunkdemo. Box2d is more powerful, but I think a little harder to use than Chipmunk.

Here's the site for Cocos2d: http://www.cocos2d-iphone.org/

Download here: http://www.cocos2d-iphone.org/download




回答2:


I prefer Box2d - I think it is easier to understand than Chipmunk. Here's a link to another question that lists many usefull resources:

Cocos2d Resources

Plus here are a few links to cocos2d / box2d tutorials:

http://www.raywenderlich.com/457/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls

http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone

http://www.raywenderlich.com/475/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12

http://www.raywenderlich.com/505/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-22

And a great book Ray is making that I think will be an awesome resource:

http://www.raywenderlich.com/2274/cocos2d-book-and-360idev

http://my.safaribooksonline.com/9780132180863

Hope these help - Happy coding!




回答3:


Chipmunk is straight C, while Box2D is C++. There is also a new set of Objective-C bindings for Chipmunk, but they are not free to use commercially.

As I understand it, Chipmunk does not support Continuous Collision Detection, but Box2D does. This is important to prevent "tunneling" (objects passing slightly through eachother when moving at high speeds)

At the end of the day, from what I hear, they're both great. If you prefer C++ to C or need continuous collision detection, you should probably choose Box2D.

If you'd rather use a pure C library, go with Chipmunk.

I personally use Box2D and my experience has been fantastic so far.

Also, I think Box2D has a different (possibly larger) set of joint types, so that could be something to consider...



来源:https://stackoverflow.com/questions/2115142/cocos2d-box2d-or-chipmunk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!