In this step, you will draw many eyes (the examples 6.1 - 6.3 from your lectures).
Create a new Processing sketch in your workspace and call it Example_6_1.
Your display window should be 100x100. Write the line of code that will ensure all subsequent shapes are drawn with no outline.
Include the following code in your sketch:
void draw()
{
background(204);
fill(255);
ellipse(50,50,60,60); //outer white circle
fill(0);
ellipse(50+10, 50, 30, 30); //black circle
fill(255);
ellipse(50+16, 46, 6, 6); //small, white circle
}
Run your code; a single eye should be drawn.
Save your work.
With your Example_6_1 sketch open, perform a Save as… and enter the name Example_6_2.
Now refactor the code above so that you have a method called eye
. This method should:
void
return type.Call the eye method twice from the draw method so that your display window is rendered like so:
Save your work.
With your Example_6_2 sketch open, perform a Save as… and enter the name Example_6_3.
Now refactor the code to call the eye method six times from the draw method so that your display window is rendered like so:
Save your work.