logo
By Lawrence

5 minutes

On Target Means Delivered

The aim line turns green when its ghost reaches the plant. A rock fired under a green line has to land there, at 30 fps as surely as at 120.

Look after every step

A frame is several fixed steps of 1/120 s, as in Draw the Shot First: two at 60 fps, four at 30. The ghost checks the plant after every step. If the game looked only once a frame, this could happen with a hole parked on the plant's edge:

step 1   the rock comes into the plant         the ghost stops here: green
step 2   the rock flies on into the hole       swallowed
frame    the plant looks, and finds nothing

So GravityBody checks the zones after every step, as the ghost does, and halts a body on the step it arrives. One that starts a frame inside a zone flies on. We swept single shots through this scene on 35 headings, past a hole parked at 8 spots 2.7 to 3.3 units from the plant's centre:

280 shots, swallowed under a green line     15 fps    30 fps    60 fps    120 fps
zones checked once a frame                  8         4         2         0
zones checked every step                    0         0         0         0

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search