The animation loop

When the user presses the Esc key:

During each iteration of the loop in Listing 3:

(I say attempt because the ball won't always move if it has collided with one of the walls.)