xxxxxxxxxx
/*Robot Valentine
Just a sweet, romantic robot eatin' some pizza made out of variables.
Created 1/17
Kali Johnston
SP 2017
knjohnston0704@gmail.com
*/
void setup() {
size (700,500);
background(255);
}
void draw() {
//Center 350,250
int x = mouseX;
int y = mouseY;
background(255);
noStroke();
//Head
rectMode(CENTER);
fill(255, 200, 200);
rect(x-50,y-225,80,50);//hat
fill(127,0,0,127);
rect(x-50,y-150,100,100);//head
//Mouth
rectMode(CENTER);
rect(x-50,y-130,50,20);
//Eyes
ellipseMode(CENTER);
ellipse(x-70,y-170,20,20);
ellipse(x-20,y-170,20,20);
//Main body
rectMode(CENTER);
fill(180,0,0,127);
rect(x-50,y,220,200);
//Legs
rectMode(CENTER);
fill(127,0,0);
rect(x+50,y+150,20,100);
rect(x-150,y+150,20,100);
//Head Baubles
fill(255,230,230);
arc(x-125,y-150,50,50,0,PI+QUARTER_PI);
arc(x+25,y-150,50,50,0,PI+QUARTER_PI);
//Pizza
fill(170,0,0);
triangle(x-50, y-75, x-200, y-50, x-250, y-75);
//arm 1
stroke(0);
noFill();
beginShape();
curveVertex(x-50,y+30);
curveVertex(x-50,y+30);
curveVertex(x-200,y-210);
curveVertex(x-250,y-150);
curveVertex(x-150,y-80);
curveVertex(x-150,y-80);
endShape();
//arm 2
stroke(0);
noFill();
beginShape();
curveVertex(x-70,y+50);
curveVertex(x-70,y+50);
curveVertex(x-310,y-100);
curveVertex(x-250,y-150);
curveVertex(x-80,y-50);
curveVertex(x-80,y-50);
endShape();
}