Here is the code I used to create this:
int mouth = 50;
int interval = 100;
float leye = 85;
float reye = 200;
int counter;
color random;
void setup() {
size(300, 400);
smooth();
}
void draw() {
counter++;
fill(81, 197, 152);
ellipse(width/2, height/2, 200, 300); // head
fill (255);
ellipse(100, 180, 40, 40); // left eye
ellipse(186, 180, 40, 40); // right eye
fill(1, 255, 0);
if (counter >= interval && counter <= interval +50) {
leye = leye +.5;
reye = reye -.5;
mouth = mouth +1;
}
if (counter >= interval+50 && counter <= interval +100) {
reye = reye +.5;
leye = leye -.5;
mouth = mouth -1;
}
fill (random (255), random (255), random (255));
ellipse(leye, 180, 10, 10); // left pupil
ellipse(reye, 180, 10, 10); // right pupil
if (counter >= interval+100) {
counter = 0;
}
fill(255, 0, 0);
ellipse(143, 280, 50, mouth); // mouth
}