This little ghost is running inside a real game loop: input → update → draw, again and again. Move it around, then pause and step through one frame, one part at a time.
1 frame = 1/60 of a second = 16.7 ms



This is the heart of the demo, a little simplified: the real thing (view the page source) also keeps the ghost inside the screen and lets you slow everything down.