Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Cocos2d-JS Game Development
  • Table Of Contents Toc
Learning Cocos2d-JS Game Development

Learning Cocos2d-JS Game Development

By : Emanuele Feronato
3.9 (11)
close
close
Learning Cocos2d-JS Game Development

Learning Cocos2d-JS Game Development

3.9 (11)
By: Emanuele Feronato

Overview of this book

If you are a Java developer who wants to learn about Java EE, this is the book for you. It's also ideal for developers who already have experience with the Java EE platform but would like to learn more about the new Java EE 7 features by analyzing fully functional sample applications using the new application server WildFly.
Table of Contents (11 chapters)
close
close
9
9. Creating Your Own Blockbuster Game – A Complete Match 3 Game
10
Index

Chapter 7. Adding Physics to Your Games Using the Box2D Engine

If you ask me what the biggest revolution in casual gaming is, no doubt I'll say physics engines. A lot of top-selling casual games such as Crayon Physics, Totem Destroyer, Crush the Castle, Angry Birds, Tiny Wings, just to mention a few use physics engines to add a realistic behavior that wouldn't be possible without such engines.

The most popular among physics engines in the 2D world is Box2D, initially written in C++, then ported to all major languages, including JavaScript.

Cocos2d-JS supports Box2D, and this chapter will cover the creation of a physics game, including these concepts:

  • Configuring and setting up Cocos2d-JS to add the Box2D engine to your games
  • Creating a physics world
  • Giving the world a realistic gravity
  • Combining bodies, shapes, and fixtures to create a physics object
  • Creating a material
  • Creating static objects
  • Creating dynamic objects
  • Attaching sprites to physics objects
  • Selecting physics objects...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Cocos2d-JS Game Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon