xxxxxxxxxx
51
function setup() {
createCanvas(400, 400);
background(255, 200, 0);
}
function draw() {
// face
stroke(0, 0, 0);
strokeWeight(4);
fill(255, 255, 255);
ellipse(200, 200, 300, 300);
//tongue
fill(255, 184, 217);
ellipse(225, 250, 30, 40);
// mouth
line(160, 260, 250, 250);
line(225, 250, 226, 260);
//cover up triangle
noStroke();
fill(255, 255, 255);
triangle(150, 258, 200, 200, 260, 247);
// eyes
if (mouseIsPressed) {
// blinking eyes
stroke(0,0,0);
strokeWeight(4);
//left eye
line(140, 200, 160, 210);
line(140, 220, 160, 210);
// right eye
line(240, 210, 260, 200);
line(240, 210, 260, 220);
} else {
//eyes
noStroke();
fill(0, 0, 0);
ellipse(150, 200, 20, 20);
ellipse(250, 200, 20, 20);
}
// nose
fill(0, 0, 0);
noStroke();
ellipse(200, 220, 30, 20);
}