Create a program that displays a window, 300 by 400, randomly placing a red ball
(circle) of diameter 20 randomly somewhere in that space. When any key is pressed,
the ball will bounce back and forth horizontally on the screen (moving in increments
of 5), never disappearing or leaving a trail. Another key press will freeze the ball in
place, another will resume the horizontal movement, and so on. (Meaning any key
“toggles” movement on and off.)
-The ball moves (and bounces) vertically as well as horizontally. Ensure it is always
completely visible (not half off the screen if you stop it).
-If the mouse is moved to the middle of the circle while it is frozen, this also starts
the circle moving (instead of a key press). Note that pressing a key should still toggle
movement on/off (not have no effect).
-The ball slows down somewhat with every bounce off a wall (so no longer always
uses increments of 5 after hitting), but it never completely stops.
-If the mouse is used to start the circle movement (ie- user did not hit a key), the
circle turns green, and resumes maximum movement (by 5s). Hitting a key will both
turn the ball back to red, and toggle movement on/off as above.