xxxxxxxxxx
30
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(220);
translate(100, 100);
//head
fill(255, 240, 200);
ellipse(0, 0, 60, 80);
//left eye
fill(255);
ellipse(-10, -5, 10, 5 * cos(frameCount / 2));
point(-10, -5);
line(-4, -14 - 2 * sin(frameCount / 2), -16, -14 + 2 * sin(frameCount / 2));
//right eye
ellipse(10, -5, 10, 5 * cos(frameCount / 2));
point(10, -5);
line(4, -14 - 2 * sin(frameCount / 2), 16, -14 + 2 * sin(frameCount/2));
//mouth
fill(200, 140, 100);
arc(0, 10, 20, 12 * sin(frameCount / 2), 0, 180, CHORD);
}