homework 2.2 part 2

//My new creation updated a little.

int s =260;
int a =540;
int b= 80;
int c= 20;

void setup() {
size(800,600);
}
void keyPressed(){
background(mouseX,mouseY,0);
}
void mousePressed(){
fill(mouseX,mouseY,0);//set red color
rect(0,0,200,445);//uno rectangle
fill(mouseX,mouseY,0);//set color green
rect(559,0,230,445);//3rd rectangle
}
void draw(){
//face
fill(39,160,54);
ellipse(400,300,200,200);

//eyes
fill(39,109,227);
ellipse(360,s,25,25);
ellipse(430,s,25,25);
fill(0,255,0);
ellipse(360,s,12,12);
ellipse(430,s,12,12);
fill(0,0,0);
ellipse(360,s,5,5);
ellipse(430,s,5,5);

//body
fill(31,147,111);
rect(370,397,60,100);//inserting rectangle

//insertting ground floor.
fill(147,61,61);
rect(0,450,800,600);
fill(255);
rect(20, a, 50, c);
rect(150, a, b, c);
rect(280, a, b, c);
rect(410, a, b, c);
rect(540, a, b, c);

fill(100-mouseX);
ellipse(mouseX,60,100,100);
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *