int counter;

int interval = 100;

float a;

float b;

float x;

void setup() {

size(300, 400);

smooth();

a = 100;

b = 186;

x = 1;

}

void draw() {

counter ++;

fill(255);

fill (255,14,50);

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);

ellipse(a, 180, 10, 10); // left pupil

ellipse(b, 180, 10, 10); // right pupil

if (counter > 0 && counter < 20) {

a = a + 1;

}

if (counter > 20 && counter < 40) {

a = a – 1;

}

if (counter > 0 && counter < 20) {

b = b + 1;

}

if (counter > 20 && counter < 40) {

b = b – 1;

}

fill(255);

ellipse(143, 280, 50, x); // mouth

if (counter > 30 && counter < 100) {

x = x + 1;

}

}

Advertisements