3A Rigid Body Physics Game

Let’s apply the math and physics from Chapter 2 to make a rigid body dynamics game, one in which things are rigid in the sense that they can’t be deformed by the forces that act on them. I’ll show you the source code in detail, describing what it does and how it does it. Just as importantly, I’ll describe the design decisions that made it look the way it does. You can download the source code from the website for this book [Parberry 12] and experiment with it yourself. My favorite rigid body dynamics game in real life is eight-ball pool, but let’s simplify things a little bit and restrict it to the end game, in which you have to sink the eight ball without sinking the cue ball.

This chapter is divided into six sections. ...

Get Introduction to Game Physics with Box2D 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.