Interactive Authoring HW3: Character

 

long timer;
float framespeed = 50;
int circleX = 100;
int circleY = 180;
int circleW = 186;
int circleZ = 180;
int circleV = 0;
int circleT = 0;
int mouth = 10;
int counter;
int interval=80;
color RanColor;
void setup() {
size(300, 400);
smooth();
timer=millis();
RanColor = color(random(255), random(255), random(255));
}
void draw() {
fill(RanColor);
counter++;
ellipse(width/2, height/2, 200, 300); // head
fill(255);
ellipse(100, 180, 40, 40); // left eye
fill(255);
ellipse(186, 180, 40, 40); // right eye
fill(255);
ellipse(145,100,20,circleT); //third eye
fill(1);
ellipse(circleX, circleY, 10, 10); // left pupil
ellipse(circleW, circleZ, 10, 10); // right pupil
fill(RanColor);
ellipse(145, 100, 6, circleV); //third pupil

fill(255);
ellipse(143, 280, 50, mouth); // mouth

if (millis() – timer > framespeed) {
timer = millis();
circleX = circleX + 1;
circleW = circleW + 1;
mouth = mouth +1;

if (mouth >= 90){
mouth = mouth – 1;

} //else {
//mouth = mouth +1;

if (circleX >= 90){
circleX = circleX – 2;
}//else {
//circleX = circleX +1;
//}

if (circleW >= 200){
circleW = circleW – 2;
} //else {
//circleW = circleW +1;
//}

if (counter >= interval){

RanColor = color(random(255), random(255), random(255));
}
if (mouth >= 20) {
circleT = circleT + 20;
}
if (mouth >= 6) {
circleV = circleV + 6;

}
if (millis() – timer > framespeed) {
timer = millis();
circleT =circleT + 20;
circleV= circleV + 6;

}
if (circleT >= 25){
circleT=circleT-20;
}
if (circleV >= 7) {
circleV=circleV-6;
}

}
}

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