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.
- The ball will be drawn in the same location during each iteration of the
- Until the random number generator returns a value that sends it away
from the wall.