The new direction
If the new direction obtained from the random number generator in
Listing 4 sends it away from the wall:
- The ball will be drawn one pixel away from the wall during the next
iteration of the animation loop.
If not:
- The ball will be drawn in the same location during each iteration of the
animation loop:
- Until the random number generator returns a value that sends it away
from the wall.