On paper, sketch out at least three animal ideas -- it can be different variations of the same animal or all different animals. You can do just a head (similar to the mouse shown in lecture) or the entire animal; the choice is up to you. If you choose to do a mouse or owl, make sure it is distinct from the ones used in this class.
Then select the one that you would like to use for the assignment and draw the animal bigger on a different piece of paper and label the points that will help you in the programming.
Program your animal in Processing, but place the drawing components into a separate
function with the name of your animal.
Create the setup()
function as you normally would, and call your animal's function from
draw()
.
Run your program and make sure everything looks as you want it to.
Add a minimum of three parameters to your animal function: representing the x-position, the
y-position, and the color of some part of the animal.
If you would like to use even more parameters, you are welcome to.
Test out calling your animal function multiple times in draw()
to create multiple
copies (i.e. instances) to make sure everything is working correctly.
Add a new function named row
with a return type of void
.
This new function should call your animal function and produce a row of a minimum of six of
your animals.
Now, call row()
from draw()
(just once) and make sure it successfully
draws a row of animals.
Add a minimum of four parameters to your row function: representing the x position, the y position, the main color of the animal, and an odd color for the one differently colored animal. An example is shown below (you can choose the odd animal's position in the row). Run your program to make sure everything is working correctly.
Write a new function named grid
with a return type of void
that draws six
rows of your animals.
The "odd" colored animal should be a different color in each row.
grid()
should have a minimum of two parameters: representing the x position and the y
position, but you can use more if it makes sense for your solution.
Return to your original animal code and change either your stroke()
or
fill()
command as shown below:
stroke(color(random(255),random(255),random(255)));
fill(color(random(255),random(255),random(255)));
It's a lot crazier! Consider why the animals no longer have their base color.
A working solution is shown on the right. No randomization (Step 7) is included in this solution.
This solution uses the mouse shown in lecture, which you are not allowed to use. Your oddly-colored animal should have a different color in each row. Your oddly-colored animal does not need to be the third from the left.
.jpg
, .png
, or
.pdf
) along with your finished .pde
file from Step 6 (or 7).