2

I am working on a platformer for iOS and was looking for the best way to incorporate the physics. The physics need only be very basic. But most of all for detection of the collision between the enemies and player, and realistic running (speeding up and slowing down gradually rather than on specific speed).

I started the project with Cocos2D for ease of incorporating graphics, and then adding effects later.

I know that Cocos2D comes included with Box2D and Chipmunk, but I've also seen that Cocos2D has basic collision to begin with. I plan on working with sprite sheets but may have the need to falling objects at some point.

All in all, I would just like some opinion on the matter. Should I or should I not add Box2D/Chipmunk to work the physics for me. And if so, which is the better of the two? Or, since as far as I am thinking, since my physics will not be very complex, work with Cocos2D basic collision detection?

user2281530
  • 21
  • 1
  • 2
  • cocos2d has no built-in collision detection mechanism, what makes you say this? Box2d and Chipmunk are on equal footing, use the one you feel more comfortable with (tip: 85% of coos2d deva prefer Box2d). The issue really depends on the type of collision shapes. For circles and rectangles collision detection is trivial, for anything else use a physics engine. – CodeSmile Apr 15 '13 at 12:15
  • By built in collision detection, I was referring to the basic functions used for checking intersection of lines, boxes, etc. It is not full collision detection in terms of a physics engine. Just basic calculation that you can call. When you say that 85% prefer box2d, where did you get that statistic? And do they prefer it because of the use of C++ for box2d? My collision checks really would only need to be be boxes and/or circles. The collision doesn't need to be dynamic. At least for now. – user2281530 Apr 15 '13 at 14:47
  • 1
    cocos2d has no such features, do you mean CGRectIntersectsRect etc? 85% is from a poll on my site with 250+ respondants. My guess is: Box2D has a nicer API, large community, and probably many users have affinity for C++. – CodeSmile Apr 15 '13 at 18:37
  • Yes, CGRectIntersectRect etc it what I meant. C++ would probably be best suited for me since it was my first programming language, especially if there is a larger community to help. Plus I hear that the function calls in box2d are much easier to understand because they aren't abbreviated. Could you post a link to your site? I've been having a hard time finding different tutorials/explanations for both physics engines so that I can get a grasp for what I would be more comfortable with. – user2281530 Apr 15 '13 at 21:29
  • Now that I think about it, CGRectIntersectRect etc are probably specific to Xcode. I just never heard about them until I started using cocos. – user2281530 Apr 15 '13 at 21:39
  • check my profile for links – CodeSmile Apr 15 '13 at 22:05
  • Chipmunk will be integrated with next Cocos2D version, fyi – raistlin Jan 16 '14 at 14:21

0 Answers0