This exercise from the textbook should be completed with the following modifications:
Use (or update) the "creature" that you completed for Projects 1 & 2.
Size of output window should be 400 by 400 pixels.
Creature should move on a diagonal,
down and to the right
from the upper-left corner of the output window
toward the lower-right corner,
by one (1) pixel each time it draws.
(Ignore the mouse pointer.)
When the mouse button is clicked:
Assign random values between zero (0) and 255 for the three colors that control
the fill color of the main portion of the "creature"
Assign a random number between 70 and 150 for the width of the "creature"
Subtract ten (10) from the background color of the output window so that it gets
a little darker each time the mouse button is clicked
When any key on the keyboard is pressed:
The creature should change directions;
if it is going to the right and down,
reverse and start going left and up;
if already going left and up, reverse
and start going right and down
Display the latest key value in the message window.
DOCUMENTATION:
Always begin each program with comment lines that give your name and the project identification,
then briefly says what your code is supposed to do (if it works!)
// Joe Bloggs, Project #3 (p3.pde):
// Diagonal move, with color changes.
Also, add some text to your sketch,
giving your name and providing some sort of title for it.
For example:
text( "Project3: Diagonal move, with color changes", 40,10);
text( "Joe Bloggs", 10,230);
The completed project with the "Processing" sketch file (the ".pde" file)
should be submitted electronically,
by creating a file named "p3.pde" in your folder,
and pasting your source code into it.