Chapter 12. Gravity
Topics in This Chapter
In Chapter 9 you saw how to simulate gravity during a sprite’s jumps and bounces by using easing functions that slow time on the sprite’s ascent and accelerate it on the descent. That manipulation of time affects all time’s derivatives, including motion, so sprites slow as they ascend and speed up as they descend, similar to how gravity acts on the objects the sprites represent.
Sometimes, however, an approximation of gravity is not enough; for example, an artillery game should be more precise about how gravity affects rounds as they fly through the air. In this short chapter, ...