Draw the ball in the new location
After the code in the switch statement finishes executing:
That is accomplished by the code in Listing 5.
Listing 5. Draw the ball in the new location.
acquire_screen(); circlefill (screen,tempX,tempY,radius,makecol(0,0,0)); circlefill (screen,x,y,radius,makecol( 128, 255, 0)); release_screen(); rest(5);//Delay for five milliseconds }// end moveBall function.