5 minutes
Draw the Shot First
The gold curve only works with one planet. Add a second mass and the formula breaks. The step doesn't care how many masses there are. So to predict a shot, we fly a ghost ball ahead of time with the same step.
The fixed step
Frames don't all take the same time. If the game stepped once per frame, a fast computer and a slow one would fly different paths. So the game never steps by the frame's time. It spends each frame's time in whole steps of 1/120 s, and carries what's left over into the next frame:

So the balls take the same steps on a slow screen and a fast one. A ghost flown with the same step does the same sums, and lands in the same place.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.