Chapter     13

Physics!

There are many games for iOS that utilize a physics simulator to control the motion of actors. In general, this usually means some library is included in the game that describes the motion of bodies in a realistic way, using real physics formulas and concepts like mass, momentum, velocity, and other principles used to describe the real world. Do physics engines provide a perfect simulation of how objects move? Not really. For starters, we will be working with the library Box2D. As the name implies, it simulates the interaction of two-dimensional (2D) bodies, which is clearly not an accurate representation of reality. However, Box2D does provide a level of realism that is good enough to trick our monkey brains into believing ...

Get Beginning iOS 6 Games Development 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.