Unlike my previous posts, I’m not going to present you a tutorial.
I would share with you an example that I ported from Box2DAS3 to Cocos2D namely the rag doll test.
Before we go any further, let me explain a bit what is Cocos2D and Box2D:
Cocos2d for iPhone is a framework for building 2D graphical and interactive applications in Objective-C. It provides high-level APIs on top of Open-GL ES to allow developers to create animations, transitions or effects easily. It’s mainly used for games. For more information you can visit the official site: http://www.cocos2d-iphone.org/.
Box2D is an open source 2D physics engine written in C++. It allows the game to simulate a real-time physics world with the management of collisions, forces (like the gravity), motion and many more. Don’t hesitate to read the official documentation here to learn more about it here: http://www.box2d.org/.
To help me to understand how worked Box2D and to know how to use it with Cocos2D, I had decided to port the Ragdoll example from the Box2DAS3 project to Cocos2D. I took the opportunity to add the management of the multi-touch and the accelerometer to allow people to enhance their user experience.
Finally, you can download it on my github.
I plan to add new examples soon. I’ll keep you in touch.