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 ...
Get Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.