O'Reilly logo

Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk by Ray Wenderlich, Rod Strougo

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

10. Basic Game Physics: Adding Realism with Box2D

So far Space Viking has been an action-packed game complete with aliens blasting, cargo ships flying, and fists bashing. Up until this point, any time you wanted to move an object in Space Viking, it was up to you. You would use Cocos2D actions or update the positions of objects manually.

But what if you wanted to add more realistic physics behavior in your game? Maybe you want more realistic collisions between objects, objects flying through the air under the influence of gravity, vehicles bouncing off terrain, or enemies collapsing like ragdolls when they are defeated.

Well, you could always crack open a physics textbook, start plugging away at some complex equations, and start developing your ...

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