Introduction to Game Physics with Box2D: 1st Edition (Paperback) book cover

Introduction to Game Physics with Box2D

1st Edition

By Ian Parberry

CRC Press

261 pages | 305 B/W Illus.

Purchasing Options:$ = USD
Paperback: 9781466565760
pub: 2013-02-06
SAVE ~$13.79
Hardback: 9781138428065
pub: 2017-07-27
SAVE ~$41.00
eBook (VitalSource) : 9781315380636
pub: 2017-09-29
from $32.98

FREE Standard Shipping!


Written by a pioneer of game development in academia, Introduction to Game Physics with Box2D covers the theory and practice of 2D game physics in a relaxed and entertaining yet instructional style. It offers a cohesive treatment of the topics and code involved in programming the physics for 2D video games.

Focusing on writing elementary game physics code, the first half of the book helps you grasp the challenges of programming game physics from scratch, without libraries or outside help. It examines the mathematical foundation of game physics and illustrates how it is applied in practice through coding examples. The second half of the book shows you how to use Box2D, a popular open source 2D game physics engine. A companion website provides supplementary material, including source code and videos.

This book helps you become a capable 2D game physics programmer through its presentation of both the theory and applications of 2D game physics. After reading the book and experimenting with the code samples, you will understand the basics of 2D game physics and know how to use Box2D to make a 2D physics-based game.

Table of Contents

Read Me First

Why Does This Book Exist?



Programming Style

Supplementary Material

I Introduction to Game Physics

Mathematics for Game Physics

Geometry and Linear Algebra

Reflections on Reflection

Digital Calculus


A Rigid Body Physics Game

The 8-Ball Pool End Game

Code Run-Through

Render World

Object World


A Soft Body Physics Toy



Soft Bodies

Ragdoll Physics

II Game Physics with Box2D

Getting Started

Download and Set Up Box2D

Overview of Box2D


Our First Box2D App

A Tale of Three Modules

The Common Module

The Math Library

The Collision Module


The Dynamics Module


The Cannon Game

The Platform and the Tower

The Heads-Up Display

The Object World

The Cannon Object

The Frame Loop and the Keyboard Handler

Son et Lumière

The Collision Module

Contacts and Manifolds

Contact Listeners


Dynamic Trees

III Appendices

For Math Geeks Only

The Blacke Arte of Program Debugging

The Debug printf

Zen and the Art of Debugging

There Are, In Fact, Dumb Questions

Lies of π

Quis Custodiet Ipsos Auditores?

Bullet Physics

Getting Started

The Dynamics World

Adding Objects

Rigid Body Dynamics

Motion States

Render Frames and Physics Frames



Exercises appear at the end of each chapter.

About the Author

Ian Parberry is a professor in the Department of Computer Science and Engineering at the University of North Texas. He is also the secretary of the Society for the Advancement of the Science of Digital Games. A pioneer of game development in academia, Dr. Parberry is the author of seven books and more than 70 articles on a wide range of computing subjects, including algorithms, complexity theory, parallel computing, neural networks, and game development. In 2010, The Princeton Review ranked his undergraduate game development program in the top 50 in North America. More than 60 professional game developers are alumni of his game development classes, including Jason West, co-founder of the Call of Duty franchise.

Subject Categories

BISAC Subject Codes/Headings:
COMPUTERS / Programming / Games