Introducing physics engines
Cocos2d v3 has an inbuilt-integrated physics engine. The physics engine it uses is actually a third-party library named Chipmunk. In the previous versions of Cocos2d, there was the option of using either Box2D or Chipmunk as they weren't built into Cocos2d, but simply could be used with Cocos2d. Now, Chipmunk support is built right into Cocos2d, which makes it very easy to use and makes it a simple choice on which engine to use. Following are the steps:
- Start by creating a new SpriteBuilder project. This app shall be named
Catapult
. - Open the project settings and change the default scaling to 2x. Remember this is for the automatic scaling that SpriteBuilder uses when importing assets.
- Import the catapult assets provided by dragging them into SpriteBuilder. Following are the two assets that will be used to create your catapult:
- Delete the template scene and add a new layer so you have more room to work with. Decorate the layer...