xxxxxxxxxx
257
let s = 0;
let r = 0;
let i = 0;
let j = 0;
let rot = 60;
let weekArray = [
"Monday",
"Monday",
"Monday",
"Tuesday",
"Tuesday",
"Tuesday",
"Tuesday",
"Wednesday",
"Wednesday",
"Wednesday",
"Thrusday",
"Thrusday",
"Thrusday",
"Friday",
"Friday",
"Friday",
"Saturday",
"Saturday",
"Saturday",
"Sunday",
"Sunday",
"Sunday",
];
let dataArray = [
"4:00 PM",
"7:00 PM ",
"11:00 PM ",
"12:00 PM ",
"3:00 PM ",
"8:00 PM ",
"12:00 AM ",
"5:00 PM ",
"7:00 PM ",
"9:00 PM ",
"12:00 PM ",
"3:00 PM ",
"7:00 PM ",
"4:00 PM ",
"6:00 PM ",
"7:00 PM ",
"6:00 PM ",
"7:00 PM ",
"8:00 PM ",
"1:00 PM ",
"6:00 PM ",
"11:00 PM ",
];
let song;
function preload() {
song = loadSound("PinkPanther.mp3");
}
function setup() {
createCanvas(600, 600);
song.loop(); // song is ready to play during setup() because it was loaded during preload
angleMode(DEGREES);
frameRate(60);
textSize(22);
textAlign(CENTER);
}
function draw() {
background(220);
//backdrop
let c = color("#d66a91");
fill(c);
rect(0, 0, 600, 600);
let cX = 640;
let cY = 480;
body();
stroke(color("#300d19"));
strokeWeight(3);
fill(color("#b0305d"));
rect(0, 430, 600, 430);
strokeWeight(2);
fill(color("#dc7f9f"));
ellipse(40, 550, 100, 50);
fill(color("#d35f88"));
ellipse(40, 550 - 10, 20, 20);
ellipse(40 + 5, 550 + 5, 20, 20);
fill(color("#701f3b"));
rect(40 + 20, 550 - 10, 15, 15);
rect(40 - 30, 550 - 10, 15, 15, 10, 5, 10, 5);
//candy
s++;
r++;
fill(color("#dc7f9f"));
ellipse(cX - r, cY, 100, 50);
fill(color("#701f3b"));
ellipse(cX - r, cY, 10, 5);
fill(color("#d35f88"));
ellipse(cX - s, cY - 10, 20, 20);
ellipse(cX - s + 5, cY + 5, 20, 20);
fill(color("#701f3b"));
rect(cX - s + 20, cY - 10, 15, 15);
rect(cX - s - 30, cY - 10, 15, 15, 10, 5, 10, 5);
if (s == 400) {
s = -150;
}
if (r == 550) {
r = 0;
j++;
i++;
}
//if(frameCount%100 == 0){
strokeWeight(1);
fill(color("#401222"));
text("(" + weekArray[j] + ", " + dataArray[i] + ")", 490, 50);
rot = rot - 0.5;
if (rot == 5) {
rot = 60;
}
lefthand(rot);
face();
eyes();
righthand();
}
function body() {
fill(color("#cf4f7e"));
push();
translate(180, 300);
rotate(-20);
rect(0, 0, 150, 280, 0, 20, 0, 0);
fill(color("#dc7f9f"));
rect(30, 30, 100, 280, 80, 80, 40, 40);
pop();
}
function face() {
push();
fill(color("#cf4f7e"));
// noStroke();
push();
translate(210, 210);
ellipse(50, -60, 35, 60); //left ear
ellipse(50, -60, 15, 30);
rotate(60);
ellipse(0, 0, 100, 160);
rotate(-90);
ellipse(-80, -30, 35, 60); //right ear
ellipse(-80, -30, 15, 30);
pop();
push(); //face
translate(240, 240);
rotate(140);
ellipse(0, 0, 100, 100);
pop();
push(); //mouth
translate(260, 270);
rotate(45);
// ellipse(20, -10, 70, 100);
rotate(-75);
push();
fill(color("#e9afc3"));
rect(-10, 25, 40, 30, 20, 20, 20, 20);
pop();
ellipse(40, 10, 50, 70);
rotate(25);
ellipse(0, 15, 50, 70);
pop();
pop();
fill(color("#90274c"));
triangle(247, 253, 280, 228, 280, 265);
}
function eyes() {
push(); //eyes
translate(205, 200);
rotate(-32);
fill(color("#e9afc3"));
ellipse(-30, 10, 50, 40);
ellipse(30, 10, 50, 40);
fill(color("#cf4f7e"));
arc(-30, 10, 50, 40, 180, 0, CHORD);
arc(30, 10, 50, 40, 180, 0, CHORD);
fill(0);
ellipse(-30, 15, 15, 10);
ellipse(30, 15, 15, 10);
pop();
}
function righthand() {
//right hand
fill(color("#cf4f7e"));
push();
translate(200, 300);
rotate(100);
rect(0, 0, 150, 30, 20, 30, 30, 20);
pop();
push();
translate(145, 425);
rotate(10);
rect(0, 0, 110, 30, 0, 0, 30, 30);
rotate(-12);
ellipse(100, 30, 60, 40);
pop();
push();
translate(250, 475);
rotate(-20);
ellipse(24, -20, 20, 30);
ellipse(18, -10, 20, 30);
ellipse(10, 0, 20, 30);
pop();
}
function lefthand(rot) {
//left hand
fill(color("#cf4f7e"));
push();
translate(314, 260);
rotate(30);
rect(0, 0, 150, 30, 30, 30, 30);
pop();
push();
translate(420, 330);
rotate(-30);
rect(0, 0, 110, 30, 30, 30, 30, 30);
rotate(-12);
ellipse(100, 30, 60, 40);
pop();
push();
translate(520, 285);
rotate(rot / 2);
ellipse(10, -40, 20, 40);
pop();
push();
translate(520, 285);
rotate(10);
ellipse(8, -20, 20, 35);
ellipse(6, 0, 20, 35);
pop();
push();
translate(520, 285);
rotate(-rot);
ellipse(-10, -40, 20, 40);
pop();
}