Interactive Authoring: Animate Face

evil-robot

 

I wanted it to look like a robot springing to life with those lifeless empty eyes becoming fully visible and instantly eye catching.

Here’s my code:

int counter;
int interval = 100;
int A = 100;
int B = 186;
int C = 110;
int D = 190;
int E = 143;
int F = 280;
//TIME
int s;

//Ham Time
boolean goFullham;

//STEPS
int step = 0;
void setup() {
size(300, 400);
smooth();
}
void draw() {
s = second();
counter ++;
if (s== 0){
step = 0;
}
fill(255);
ellipse(width/2, height/2, 200, 300); // head
fill(200);
ellipse(C, 180, 40, 40); // left eye
ellipse(D, 180, 40, 40); // right eye
fill(1);
fill (255, 0,0);
ellipse(A, 180, 10, 10); // left pupil
ellipse(B, 180, 10, 10); // right pupil
fill(255);
ellipse(143, 280, 50, 1); // mouth

//MOVING THE EYES
if (counter < interval){
A = A + 1;
B= B + 1;
C= C + 1;
D = D +1;
}
if (A >= 115){

A = 115;
step = 1;
ellipse(A, 180, 10, 10); // left pupil
ellipse(B, 180, 10, 10); // right pupil
ellipse(C, 180, 40, 40); // left eye
ellipse(D, 180, 40, 40); // right eye

fill(255);

}
if (B >= 200){
B = 200;
step = 1;
}
if (C >= 155){
C = 155;
}
if (D >=200){
D = 200;
}
if(step == 1){
A= A-1;
B= B-1;
C= C-1;
D= D-1;
if (A <= 80){
A= 80;
}
if (B <= 160){
B = 160;
step = 2;
}
if (C <= 70){
C = 70;
}
if (D <=170){
D = 170;
}
}
if (step == 2){
ellipse(E, F, 50, 1); // mouth
E= E + 1;
F= F + 1;

step = 3;
}
if (step == 3){
F = F- 1;
E = E – 1;
step = 4;
}
if ( F >= 320);{
F = 320;
}
if ( E >= 180){
E = 180;
}

if (step == 4){ // Make this loop
counter = 3;
if (counter == 3){

step = 5;
}
if (step == 1){ //Give him chicken pox
goFullham = true;
}
if (goFullham == true){
fill(random(255));
ellipse(150, 90, 10, 10);
}
}

}

Advertisements

About Alex Mandzi

I'm a new artist and wish to become a game designer. I like cartoons and draw them as well.
This entry was posted in Non-Time-Based and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s