Happy Days

VIMEO

CODE:
PFont font;
int h, m, s;
int elm = 130;
int lpw = 100;
int rpw = 186;
int step = 0;
int dem = 10;

void setup() {
font = createFont(“Times”, 20);
textFont(font);
size(300, 400);
smooth();
}

void draw() {
background (200);

fill (250, 218, 94); //hair
stroke (250, 218, 94);
rect (59, 262, 181, 114);

fill (255, 229, 180); // head
stroke (255, 229, 180);
ellipse(width/2, height/2, 200, 300);
rect (122, 326, 50, 50);
ellipse (155, 404, 177, 71);

fill(255);
stroke (255);
ellipse(100, 180, 40, 40); // left eye
ellipse(186, 180, 40, 40); // right eye
fill(0, 255, 255);
stroke (0, 255, 255);
ellipse(lpw, 180, dem, dem); // left pupil
ellipse(rpw, 180, dem, dem); // right pupil

fill (255, 229, 180);
stroke (255, 229, 180);
ellipse(100, elm, 40, 40); // left lid
ellipse(186, elm, 40, 40); // right lid
stroke (0);

fill (244, 194, 194); //cheeks
stroke (244, 194, 194);
ellipse (225, 218, 62, 39);
ellipse (70, 218, 62, 39);

fill (250, 218, 94); //hair
stroke (250, 218, 94);
ellipse (234, 180, 31, 105);
ellipse (63, 183, 30, 100);
ellipse (129, 152, 14, 89);

fill (0); //hat
stroke (0);
ellipse (234, 72, 100, 100);
ellipse (64, 72, 96, 100);
ellipse (145, 94, 171, 89);
rect (51, 62, 194, 86);

fill (230, 32, 32); //dress
stroke (230, 32, 32);
ellipse (227, 399, 75, 75);
ellipse (78, 396, 75, 75);

arc(148, 264, 77, 116, 0, PI); // mouth

//clock
h = hour();
m = minute();
s = second();
textSize (50);
text(h + “:” + m, 90, 135);

if (step == 0) {
lpw = 100;
rpw = 186;
} else if (step == 1) {
rpw = rpw+1;
if (rpw >= 196) {
rpw = 196;
}
lpw = lpw+1;
if (lpw >= 110) {
lpw = 110;
}
} else if (step == 2) { //STEP 2 to the left
rpw = rpw-1;
if (rpw <= 176) {
rpw = 176;
}
lpw = lpw-1;
if (lpw <= 90) { lpw = 90; } } else if (step == 3) { elm = elm +1; if (elm >= 176) {
elm = 176;
}
} else if (step == 4) {
elm = elm -1;
if (elm <= 130) { elm = 130; } } else if (step == 5) { dem = dem*2; if (dem >= 35) {
dem = 35;
}
} else if (step == 6) {
dem = dem/2;
if (dem <= 10) { dem = 10; } } else if (step == 7) { background (0); fill (255, 0, 0); textSize (random(50)); text (“STOP”, random(250), random(400)); fill (195); //hair stroke (195); rect (59, 262, 181, 114); fill (235); // head stroke (235); ellipse(width/2, height/2, 200, 300); rect (122, 326, 50, 50); ellipse (155, 404, 177, 71); fill(250); stroke (250); ellipse(100, 180, 40, 40); // left eye ellipse(186, 180, 40, 40); // right eye fill(255, 0, 0); stroke (255, 0, 0); ellipse(lpw, 180, dem + 5, dem + 5); // left pupil ellipse(rpw, 180, dem + 5, dem + 5); // right pupil fill (235); stroke (235); ellipse(100, elm, 40, 40); // left lid ellipse(186, elm, 40, 40); // right lid stroke (0); fill (210); //cheeks stroke (210); ellipse (225, 218, 62, 39); ellipse (70, 218, 62, 39); fill (195); //hair stroke (195); ellipse (234, 180, 31, 105); ellipse (63, 183, 30, 100); ellipse (129, 152, 14, 89); fill (50); //hat stroke (50); ellipse (234, 72, 100, 100); ellipse (64, 72, 96, 100); ellipse (145, 94, 171, 89); rect (51, 62, 194, 86); fill (177); //dress stroke (177); ellipse (227, 399, 75, 75); ellipse (78, 396, 75, 75); ellipse(143, 280, 50, 1); // mouth fill (255, 0, 0); textSize (random(50)); text (“my life is a lie”, random(150), random(400)); fill (105); textSize (20); text (“it hurts”, random (250), random (400)); fill (105); textSize (20); text (“go away”, random (250), random (400)); fill (105); textSize (20); text (“no more”, random (250), random (400)); } //step change if (s > 0 && s < 2) { step = 1; } else if (s > 2 && s < 4) { step = 2; } else if (s > 4 && s < 6) { step = 1; } else if (s > 6 && s < 8) { step = 2; } else if (s > 8 && s < 11) { step = 0; } else if (s > 11 && s < 13) { step = 3; } else if (s > 13 && s < 14) { step = 4; } else if (s > 14 && s < 15) { step = 3; } else if (s > 15 && s < 17) { step = 4; } else if (s > 17 && s < 22) { step = 5; } else if (s > 22 && s < 24) { step = 3; } else if (s > 24 && s < 26) { step = 4; } else if (s > 26 && s < 35) { step = 6; } else if (s > 35 && s < 40) { step = 1; } else if (s > 40 && s < 42) { step = 2; } else if (s > 42 && s < 44) { step = 0; } else if (s > 44 && s < 46) { step = 3; } else if (s > 46 && s < 48) { step = 4; } else if (s > 48 && s < 50) { step = 3; } else if (s > 50 && s < 52) { step = 4; } else if (s > 52 && s < 59) {
step = 7;
}
}

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