Assignments+-+Processing

__Ex. 1. Create Rectangles__
Try to guess what the instructions would be for the following image.



__Help:__ 1. The size of the stage is 200x200; 2. Background of the stage is white 3. Create 2 rectangles - black and grey (150); 4. Rectangle should have 4 coordinates. 4. Put fill for the rectangles before creating the rectangle.

__Ex. 2. Guess Colors__
Complete the following program. Guess what RGB values to use.

code // Blue fill(________,________,________); ellipse(20,50,16,16); // Green fill(________,________,________); ellipse(40,50,16,16); // Red fill(________,________,________); ellipse(60,50,16,16); // Yellow fill(________,________,________); ellipse(80,50,16,16); code

__Help:__

1. The size of the stage is default.

2. You need three values for RGB color.

3. In this exercise, you have to create RGB colors with combination of 0 (black) and 255 (white).

Ex. 3. Fix the Errors code size(200,200; background; stroke 255; fill(150) rect(100,100,50); code

__Ex. 4. Complete a Cartoon Character__
Complete a Cartoon Character so the rest of the body moves with his body.

code void setup { size(200,200); smooth; }

void draw { background(255);

//Set ellipses and rects to CENTER mode ellipseMode(CENTER); rectMode(CENTER);

//Draw body stroke(0); fill(175); //body is drawn at the location (mouseX, mouseY). rect(mouseX,mouseY,20,100)

//Draw body stroke(0); fill(255); ellipse(mouseX,mouseY-30,60,60);
 * head is drawn above the body at the location (mouseX, mouseY - 30).**//**

//Draw eyes fill(0); //eyes are drawn by subtracting/adding numbers from mouseX (example, mouseX-19 and mouseX+20) ellipse(___,___ ,16,32); ellipse(___,___ ,16,32);

//Draw legs stroke(0); //legs are drawn by subtracting/adding numbers from mouseX and mouseY (mouseX-10,mouseY+50,mouseX-20,mouseY+60) line(___,___,___,___); line(___,___,___,___); } code