Processing animation

animation

// processing sound library
import processing.sound.*;
SoundFile file;
//time
int counter;
int interval = 100;
//eye,mouth & images
int E = 180;
int d = 1;
int c = 50;
PImage img;
PImage img1;
PImage img2;
PImage img3;
PFont font;
void setup() {
font = createFont(“Times”,20);
size(300, 400);
smooth();
//load sound file
file = new SoundFile(this, “01-01- All Star.mp3”);
file.play();
//load image
img = loadImage(“high res sky.jpg”);
img1 = loadImage(“the world.jpg”);
img2 = loadImage(“shed.jpg”);
img3 = loadImage(“finger.jpg”);
}
void draw() {
counter ++;
image(img, 0, 0);
text(counter,20,20);
fill(252,255,250);
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(100, E, 10, 10); // left pupil
ellipse(186, E, 10, 10); // right pupil

fill(255);
ellipse(143, 280, c, d); // mouth

//time
if (counter == 20){
d = 10;
}
if (counter == 30){
d = 1;
}
if (counter == 50){
d = 16;
c = 40;
}
if (counter == 65){
d = 1;
c = 50;
}
if (counter == 75){
d = 10;
}
if (counter == 85){
d = 4;
}
if (counter == 95){
d = 15;
}
if (counter == 95){
d = 4;
}
if (counter == 105){
d = 20;
c = 40;
}
if (counter == 115){
d = 4;
c = 50;
}
if (counter == 125){
d = 15;
}
if (counter == 145){
d = 4;
}
if (counter == 155){
d = 1;
}
if (counter == 160){
d = 13;
}
if (counter == 175){
d = 13;
}
if (counter == 195){
d = 1;
img = img1;
}
if (counter == 205){
d = 15;
}
if (counter == 215){
d = 1;
}
if (counter == 225){
d = 10;
}
if (counter == 235){
d = 1;
}
if (counter == 248){
d = 10;
}
if (counter == 255){
d = 1;
}
if (counter == 268){
d = 10;
}
if (counter == 290){
d = 1;
}
if (counter == 305){
d = 10;
}
if (counter == 315){
d = 1;
}
if (counter == 325){
d = 12;
}
if (counter == 335){
d = 4;
}
if (counter == 345){
d = 12;
}
if (counter == 350){
d = 4;
}
if (counter == 365){
d = 12;
}
if (counter == 375){
d = 4;
}
if (counter == 385){
d = 12;
}
if (counter == 395){
d = 3;
}
if (counter == 405){
d = 12;
}
if (counter == 415){
d = 4;
}
if (counter == 425){
d = 12;
}
if (counter == 435){
d = 3;
}
if (counter == 445){
d = 12;
}
if (counter == 455){
d = 4;
}
if (counter == 465){
d = 12;
}
if (counter == 475){
d = 3;
}
if (counter == 485){
d = 12;
}
if (counter == 490){
d = 14;
img = img2;
}
if (counter == 500){
d = 12;
}
if (counter == 520){
d = 1;
}
if (counter == 590){
d = 11;
}
if (counter == 600){
d = 4;
}
if (counter == 610){
d = 11;
}
if (counter == 620){
d = 4;
}
if (counter == 630){
d = 11;
}
if (counter == 640){
d = 4;
}
if (counter == 650){
d = 11;
}
if (counter == 660){
d = 4;
}
if (counter == 670){
d = 11;
}
if (counter == 680){
d = 4;
}
if (counter == 690){
d = 11;
}
if (counter == 700){
d = 4;
}
if (counter == 710){
d = 11;
}
if (counter == 720){
d = 4;
}
if (counter == 730){
d = 11;
}
if (counter == 740){
d = 4;
}
if (counter == 750){
d = 11;
img = img3;
E = E+1;
}
if (counter == 755){
E = E+2;
}
if (counter == 760){
d = 14;
E = E+2;
}
if (counter == 762){
E = E+1;
}
if (counter == 765){
E = E+1;
}
if (counter == 770){
d = 11;
E = E+1;
}
if (counter == 775){
E = E+1;
}
if (counter == 780){
d = 4;
E = E+1;
}
if (counter == 790){
d = 11;
}
if (counter == 800){
d = 4;
}
if (counter == 810){
d = 11;
}
if (counter == 820){
d = 4;
}
if (counter == 830){
d = 11;
}
if (counter == 840){
d = 4;
}
if (counter == 850){
d = 11;
}
if (counter == 860){
d = 4;
}
if (counter == 870){
d = 11;
}
if (counter == 880){
d = 4;
}
if (counter == 895){
d = 11 ;
}
if (counter == 905){
d = 1 ;
}
if (counter == 920){
d = 11 ;
}
if (counter == 930){
d = 4 ;
}
if (counter == 940){
d = 11 ;
}
if (counter == 950){
d = 4 ;
}
if (counter == 960){
d = 11 ;
}
if (counter == 970){
d = 1 ;
}
if (counter == 990){
d = 11 ;
}
if (counter == 1000){
d = 4 ;
}
if (counter == 1010){
d = 11 ;
}
if (counter == 1020){
d = 4 ;
}
if (counter == 1030){
d = 11 ;
E = E-1;
}
if (counter == 1035){
E = E-2;
}
if (counter == 1040){
d = 4 ;
E = E-2;
}
if (counter == 1042){
E = E-1;
}
if (counter == 1045){
E = E-1;
}
if (counter == 1050){
d = 11 ;
E = E-1;
}
if (counter == 1055){
E = E-1;
}
if (counter == 1060){
d = 14 ;
E = E-1;
}
if (counter == 1065){
d = 11 ;
}
if (counter == 1075){
d = 1 ;
}
}

 

Advertisements
This entry was posted in Uncategorized. 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