Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cocos2d Game Development Essentials

You're reading from   Cocos2d Game Development Essentials For new users - a quickstart guide to bringing your mobile game ideas to life with Cocos2D

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784390327
Length 136 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ben Trengrove Ben Trengrove
Author Profile Icon Ben Trengrove
Ben Trengrove
Arrow right icon
View More author details
Toc

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:

  1. Start by creating a new SpriteBuilder project. This app shall be named Catapult.

  2. Open the project settings and change the default scaling to 2x. Remember this is for the automatic scaling that SpriteBuilder uses when importing assets.

  3. Import the catapult assets provided by dragging them into SpriteBuilder. Following are the two assets that will be used to create your catapult:

    catapult_arm.png

    catapult_base.png

  4. Delete the template scene and add a new layer so you have more room to work with. Decorate the layer with a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image