Projectiles

One of the easiest types of motion to spot in a game is projectile motion. Any object that has been thrown, kicked, or shot and that is flying through the air is considered a projectile. Think about the last time you threw a baseball or kicked a soccer ball. What type of path did the ball follow? That's right—it followed a parabolic path! You might want to flip back to Chapter 2, “Geometry Snippets,” for a quick review of the parabola. Check out the parabola that opens downward. Doesn't it look like the trajectory of a missile that's just been shot at an angle? Any first-person or third-person shooter will have tons of projectiles, so how do we model them mathematically?

The easiest way to approach a 2D projectile is to break all ...

Get Beginning Math and Physics for Game Programmers 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.