O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

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

Forces

When you're getting ready to start the physics simulation portion of the code, the first step is to brainstorm all the forces that are acting on the object you want to move. The sum (or total) of all those forces determines how the object moves. Some of the forces are obvious: an enemy punches or kicks the player, the player pushes a large object out of the way, a ball is thrown, or a missile is launched. However, some less-obvious forces often get overlooked: gravity, friction, wind resistance (if it's significant), or the normal force. Let's stop and take a closer look at how each of these forces works, starting with gravity.

Earlier, we discussed acceleration due to gravity, which is represented in most formulas as the constant g.

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