O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Physics

The topics covered in this chapter are as follows:

  • Adding physics to a game scene
  • Adding physics objects
  • Looking at different body types
  • Adding sprite texture to physics objects
  • Creating composite bodies
  • Creating complex shapes
  • Changing body properties
  • Applying impulse with the touch control
  • Applying force with the accelerometer
  • Collision detection
  • Adding revolute joints
  • Adding motor joints
  • Adding a game loop and scoring

Introduction

There are a lot of games in the App Store that use physics, which has been made very popular by the famous game "Angry Birds". Physics engines add realism to the game and make it a lot more interesting. It also makes it a lot easier. All you have to do is provide the initial parameters, and the physics engine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required