SA 4, due Wed, Jan 14
To practice state, write a sketch that does the following.
- A ball starts off at the upper left.
- Every frame, the ball moves one step to the right, and a random amount, between -1 and 1, up or down.
- Every frame, the ball has a random size (same for its width and height), between 1 and 10 units.
- The ball is drawn in white, and the screen slowly fades away to black.
- When the mouse is pressed, the ball starts back on the left at a random y position.
Avoid the use of magic numbers; in particular, make sure that the sketch will still work properly if the size is changed.
[applet]
As always, turn in the zipfile on Blackboard, as SA 4 in the Assignments section. In the field where you can type in some information, please tell me roughly how long this assignment took, and if there were any particular difficulties.