The drawing code
Listing 5 draws a black ball at the old
coordinates (see Listing 4):
- That were saved in tempX and tempY.
That erases the old image:
- Because a black ball cannot be seen in front of a black background.
Then Listing 5 draws a new green ball:
- At the location specified by the x and y coordinates
- Produced by the code in the switch statement in
Listing 4.