O'Reilly logo

Pro HTML5 Games by Aditya Ravi Shankar

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

CHAPTER 3

image

Physics Engine Basics

A physics engine is a program that provides an approximate simulation of a game world by creating a mathematical model for all the object interactions and collisions within the game. It accounts for gravity, elasticity, friction, and conservation of momentum between colliding objects so that the objects move in a believable way. For our game, we are going to be using an existing and very popular physics engine called Box2D.

The Box2D engine is a free, open source physics engine that was originally written in C++ by Erin Catto. It has been used in a lot of popular physics-based games, including Crayon Physics Deluxe ...

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