/* BUNBUN IS STRANDED IN THE PACIFIC OCEAN > MOVE the carrot around to grab BunBun's attention. Notice how days literally go by... he is very hungry! > CLICK and BunBun will catch the carrot > what's that? The carrot moves? > oh. forgot to tell you... > BunBun will never catch the carrot. > press F (OR ANY KEY) to pay respects. Credits: Alice (Yi Yang) peng */ //GRID SET UP void setup() { size(400, 400);//set canvas size to 400x400 println("HELP ME CATCH THE CARROT"); //print opening statement noCursor(); // *ACQUIRED CURSOR UPGRADE* } void draw() { //background/animation setup frameRate(40); noStroke(); //dark sky background(250, 233, 171,mouseX); //set background colour fill(51,31,25,(400-mouseX)*.7); //light sky rect(0,0,400,400); //***THE STARS*** fill(250, 233, 171,(400-mouseX)); ellipse(40,40,5+sin(frameCount/3),5+sin(frameCount/3)); ellipse(300,30,5+sin(frameCount),5+sin(frameCount)); ellipse(290,160,5+sin(frameCount/2),5+sin(frameCount)); ellipse(80,100,5+sin(frameCount/2),5+sin(frameCount/2)); ellipse(210,55,5+sin(frameCount),5+sin(frameCount)); ellipse(110,20,2+sin(frameCount),2+sin(frameCount)); ellipse(15,170,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(300,90,2+sin(frameCount),2+sin(frameCount)); ellipse(370,10,2+sin(frameCount),2+sin(frameCount/3)); ellipse(150,190,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(360,120,3+sin(frameCount),3+sin(frameCount)); ellipse(110,160,2+sin(frameCount),2+sin(frameCount/3)); //***THE SUN*** fill(255,248,210,90); ellipse(200,260-mouseX*0.5,100+sin(frameCount/5)*2,100+sin(frameCount/5)*2); fill(255,248,210); ellipse(200,260-mouseX*0.5,80+sin(frameCount/6),80+sin(frameCount/6)); fill(255,240,150); ellipse(200,260-mouseX*0.5,65+sin(frameCount/3),65+sin(frameCount/3)); fill(255,221,81); ellipse(200,260-mouseX*0.5,52+sin(frameCount/7),52+sin(frameCount/7)); fill(255,176,33); ellipse(200,260-mouseX*0.5,36+sin(frameCount/5),36+sin(frameCount/5)); //***THE MOON*** fill(255,241,188); ellipse(200,-140+(400-mouseX)*0.5,70,70); //THE WATER fill(207,243,255); rect(0,180,400,400); //***ICEBERG SECTIONS UNDERWATER*** fill(198,212,222); //color is grey //circular one (static) triangle(149,257,250,255,210,300); triangle(149,257,250,255,170,285); //top right (animated and follows mouse) triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+260); triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,290+mouseX*0.03,2*sin(frameCount/10.0)+250); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+320,5+mouseX*0.03,2*sin(frameCount/10.0)+335, 80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315); triangle(80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //filterfor night time fill(51,31,25,(400-mouseX)*.1); rect(0,0,400,400); //***SHADING FOR ICE*** fill(232, 232, 232); //color is light grey //circular one (static) ellipse(200,255,100,40); //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+182,270+mouseX*0.03,2*sin(frameCount/10.0)+235, 400+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+182); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+275,5+mouseX*0.03,2*sin(frameCount/10.0)+320, 80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //***(TOPS OF) BLOCKS OF ICE*** fill(255); //white //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+177,270+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+165); ellipse(200,250,100,40); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+270,5+mouseX*0.03,2*sin(frameCount/10.0)+300, 80+mouseX*0.03,2*sin(frameCount/10.0)+310, 100+mouseX*0.03,2*sin(frameCount/10.0)+270); //bottom right (animated and contrasts mouse position) quad(220-mouseX*0.05,2*sin(frameCount/10.0)+370,320-mouseX*0.05,2*sin(frameCount/10.0)+360, 350-mouseX*0.05,2*sin(frameCount/10.0)+400,210-mouseX*0.05,2*sin(frameCount/10.0)+400); //some settings rectMode(CORNERS); ellipseMode(CENTER); fill(255, 255, 255); noStroke(); //***BUNNY*** //HEAD ellipse(148, 4*sin(frameCount/10.0)+130, 60, 60); ellipse(248, 4*sin(frameCount/10.0)+130, 60, 60); rect(148, 4*sin(frameCount/10.0)+100, 248, 4*sin(frameCount/10.0)+160); //EARS ellipse(143, 4*sin(frameCount/10.0)+100, 20, 120); ellipse(252, 4*sin(frameCount/10.0)+100, 20, 120); //EYES fill(0, 0, 0); ellipse(149+mouseX*0.02, 4*sin(frameCount/10.0)+117+mouseY*0.02, 4, 4); ellipse(239+mouseX*0.02, 4*sin(frameCount/10.0)+117+mouseY*0.02, 4, 4); //CHEEKS fill(255, 204, 204); ellipse(151, 4*sin(frameCount/10.0)+133, 10, 4); ellipse(245, 4*sin(frameCount/10.0)+133, 10, 4); //CIRCLE UNDER BODY fill(196, 194, 190); ellipse(200, 250, 60+10*sin(frameCount/10.0), 25); fill(198,212,222); //BODY fill(255); rect(170, 4*sin(frameCount/10.0)+159, 230, 4*sin(frameCount/10.0)+220); //torso ellipse(225, 4*sin(frameCount/10.0)+220, 10, 30); //leg ellipse(175, 4*sin(frameCount/10.0)+220, 10, 30); //leg //ARMS fill(255); stroke(255); strokeWeight(5); line(175,6*sin(frameCount/10.0)+ 177, 160, 6*sin(frameCount/2.0)+185); line(225,6*sin(frameCount/10.0)+177, 240, 6*sin(frameCount/2.0)+185); //CARROT stroke(120,181,28); strokeWeight(4); line(mouseX,mouseY-20,mouseX-7,mouseY-30); line(mouseX,mouseY-20,mouseX+10,mouseY-36); line(mouseX,mouseY-20,mouseX,mouseY-34); noStroke(); fill(255,165,50); ellipse(mouseX,mouseY,15,40); stroke(71,46,14); strokeWeight(2); line(mouseX+-5,mouseY+2,mouseX+2,mouseY+2); line(mouseX+-6,mouseY-2,mouseX+2,mouseY-2); } void mousePressed(){ //setup frameRate(2); println ("DARN!");//print reaction noStroke(); //light sky background(250, 233, 171,mouseX); //set background colour fill(51,31,25,(400-mouseX)*.7); //dark sky rect(0,0,400,400); //***THE STARS*** fill(250, 233, 171,(400-mouseX)); ellipse(40,40,5+sin(frameCount/3),5+sin(frameCount/3)); ellipse(300,30,5+sin(frameCount),5+sin(frameCount)); ellipse(290,160,5+sin(frameCount/2),5+sin(frameCount)); ellipse(80,100,5+sin(frameCount/2),5+sin(frameCount/2)); ellipse(210,55,5+sin(frameCount),5+sin(frameCount)); ellipse(110,20,2+sin(frameCount),2+sin(frameCount)); ellipse(15,170,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(300,90,2+sin(frameCount),2+sin(frameCount)); ellipse(370,10,2+sin(frameCount),2+sin(frameCount/3)); ellipse(150,190,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(360,120,3+sin(frameCount),3+sin(frameCount)); ellipse(110,160,2+sin(frameCount),2+sin(frameCount/3)); //***THE SUN*** fill(255,248,210,90); ellipse(200,260-mouseX*0.5,100+sin(frameCount/5)*2,100+sin(frameCount/5)*2); fill(255,248,210); ellipse(200,260-mouseX*0.5,80+sin(frameCount/6),80+sin(frameCount/6)); fill(255,240,150); ellipse(200,260-mouseX*0.5,65+sin(frameCount/3),65+sin(frameCount/3)); fill(255,221,81); ellipse(200,260-mouseX*0.5,52+sin(frameCount/7),52+sin(frameCount/7)); fill(255,176,33); ellipse(200,260-mouseX*0.5,36+sin(frameCount/5),36+sin(frameCount/5)); //***THE MOON*** fill(255,241,188); ellipse(200,-140+(400-mouseX)*0.5,70,70); //THE WATER fill(207,243,255); rect(0,180,400,400); //***ICEBERG SECTIONS UNDERWATER*** fill(198,212,222); //color is grey //circular one (static) triangle(149,257,250,255,210,300); triangle(149,257,250,255,170,285); //top right (animated and follows mouse) triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+260); triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,290+mouseX*0.03,2*sin(frameCount/10.0)+250); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+320,5+mouseX*0.03,2*sin(frameCount/10.0)+335, 80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315); triangle(80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //filterfor night time fill(51,31,25,(400-mouseX)*.1); rect(0,0,400,400); //***SHADING FOR ICE*** fill(232, 232, 232); //color is light grey //circular one (static) ellipse(200,255,100,40); //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+182,270+mouseX*0.03,2*sin(frameCount/10.0)+235, 400+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+182); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+275,5+mouseX*0.03,2*sin(frameCount/10.0)+320, 80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //***(TOPS OF) BLOCKS OF ICE*** fill(255); //white //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+177,270+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+165); ellipse(200,250,100,40); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+270,5+mouseX*0.03,2*sin(frameCount/10.0)+300, 80+mouseX*0.03,2*sin(frameCount/10.0)+310, 100+mouseX*0.03,2*sin(frameCount/10.0)+270); //bottom right (animated and contrasts mouse position) quad(220-mouseX*0.05,2*sin(frameCount/10.0)+370,320-mouseX*0.05,2*sin(frameCount/10.0)+360, 350-mouseX*0.05,2*sin(frameCount/10.0)+400,210-mouseX*0.05,2*sin(frameCount/10.0)+400); //some settings rectMode(CORNERS); ellipseMode(CENTER); fill(255, 255, 255); noStroke(); //***BUNNY*** //HEAD ellipse(148, 4*sin(frameCount/10.0)+130, 60, 60); ellipse(248, 4*sin(frameCount/10.0)+130, 60, 60); rect(148, 4*sin(frameCount/10.0)+100, 248, 4*sin(frameCount/10.0)+160); //EARS ellipse(143, 4*sin(frameCount/10.0)+100, 20, 120); ellipse(252, 4*sin(frameCount/10.0)+100, 20, 120); //EYES fill(0, 0, 0); ellipse(149+mouseX*0.02, 4*sin(frameCount/10.0)+117+mouseY*0.02, 4, 4); ellipse(239+mouseX*0.02, 4*sin(frameCount/10.0)+117+mouseY*0.02, 4, 4); //CHEEKS fill(255, 204, 204); ellipse(151, 4*sin(frameCount/10.0)+133, 10, 4); ellipse(245, 4*sin(frameCount/10.0)+133, 10, 4); //CIRCLE UNDER BODY fill(196, 194, 190); ellipse(200, 250, 60+10*sin(frameCount/10.0), 25); fill(198,212,222); //BODY fill(255); rect(170, 4*sin(frameCount/10.0)+159, 230, 4*sin(frameCount/10.0)+220); //torso ellipse(225, 4*sin(frameCount/10.0)+220, 10, 30); //leg ellipse(175, 4*sin(frameCount/10.0)+220, 10, 30); //leg //ARMS fill(255); stroke(255); strokeWeight(5); line(175,177, mouseX-20,mouseY); line(225,177, mouseX+20,mouseY); //CARROT stroke(120,181,28); strokeWeight(4); line(mouseX+50,mouseY+20-20,mouseX+50-7,mouseY+20-30); line(mouseX+50,mouseY+20-20,mouseX+50+10,mouseY+20-36); line(mouseX+50,mouseY+20-20,mouseX+50,mouseY+20-34); noStroke(); fill(255,165,50); ellipse(mouseX+50,mouseY+20,15,40); stroke(71,46,14); strokeWeight(2); line(mouseX+50+-5,mouseY+20+2,mouseX+50+2,mouseY+20+2); line(mouseX+50+-6,mouseY+20-2,mouseX+50+2,mouseY+20-2); } void keyPressed(){ frameRate(1.5); println ("I'LL CATCH YOU IN MY NEXT LIFE!"); //print dying wish noStroke(); //light sky background(250, 233, 171,mouseX); //set background colour //black sky fill(51,31,25,(400-mouseX)*.7); rect(0,0,400,400); //***THE STARS*** fill(250, 233, 171,(400-mouseX)); ellipse(40,40,5+sin(frameCount/3),5+sin(frameCount/3)); ellipse(300,30,5+sin(frameCount),5+sin(frameCount)); ellipse(290,160,5+sin(frameCount/2),5+sin(frameCount)); ellipse(80,100,5+sin(frameCount/2),5+sin(frameCount/2)); ellipse(210,55,5+sin(frameCount),5+sin(frameCount)); ellipse(110,20,2+sin(frameCount),2+sin(frameCount)); ellipse(15,170,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(300,90,2+sin(frameCount),2+sin(frameCount)); ellipse(370,10,2+sin(frameCount),2+sin(frameCount/3)); ellipse(150,190,2+sin(frameCount/3),2+sin(frameCount/3)); ellipse(360,120,3+sin(frameCount),3+sin(frameCount)); ellipse(110,160,2+sin(frameCount),2+sin(frameCount/3)); //***THE SUN*** fill(255,248,210,90); ellipse(200,260-mouseX*0.5,100+sin(frameCount/5)*2,100+sin(frameCount/5)*2); fill(255,248,210); ellipse(200,260-mouseX*0.5,80+sin(frameCount/6),80+sin(frameCount/6)); fill(255,240,150); ellipse(200,260-mouseX*0.5,65+sin(frameCount/3),65+sin(frameCount/3)); fill(255,221,81); ellipse(200,260-mouseX*0.5,52+sin(frameCount/7),52+sin(frameCount/7)); fill(255,176,33); ellipse(200,260-mouseX*0.5,36+sin(frameCount/5),36+sin(frameCount/5)); //***THE MOON*** fill(255,241,188); ellipse(200,-140+(400-mouseX)*0.5,70,70); //THE WATER fill(207,243,255); rect(0,180,400,400); //***ICEBERG SECTIONS UNDERWATER*** fill(198,212,222); //color is grey //circular one (static) triangle(149,257,250,255,210,300); triangle(149,257,250,255,170,285); //top right (animated and follows mouse) triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+260); triangle(270+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03, 2*sin(frameCount/10.0)+235,290+mouseX*0.03,2*sin(frameCount/10.0)+250); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+320,5+mouseX*0.03,2*sin(frameCount/10.0)+335, 80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315); triangle(80+mouseX*0.03,2*sin(frameCount/10.0)+335,80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //filter for night time fill(51,31,25,(400-mouseX)*.1); rect(0,0,400,400); //***SHADING FOR ICE*** fill(232, 232, 232); //color is light grey //circular one (static) ellipse(200,255,100,40); //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+182,270+mouseX*0.03,2*sin(frameCount/10.0)+235, 400+mouseX*0.03,2*sin(frameCount/10.0)+235,400+mouseX*0.03,2*sin(frameCount/10.0)+182); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+275,5+mouseX*0.03,2*sin(frameCount/10.0)+320, 80+mouseX*0.03,2*sin(frameCount/10.0)+315, 100+mouseX*0.03,2*sin(frameCount/10.0)+275); //***(TOPS OF) BLOCKS OF ICE*** fill(255); //white //top right (animated and follows mouse) quad(300+mouseX*0.03,2*sin(frameCount/10.0)+177,270+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+230, 400+mouseX*0.03,2*sin(frameCount/10.0)+165); ellipse(200,250,100,40); //middle left (animated and follows mouse) quad(5+mouseX*0.03,2*sin(frameCount/10.0)+270,5+mouseX*0.03,2*sin(frameCount/10.0)+300, 80+mouseX*0.03,2*sin(frameCount/10.0)+310, 100+mouseX*0.03,2*sin(frameCount/10.0)+270); //bottom right (animated and contrasts mouse position) quad(220-mouseX*0.05,2*sin(frameCount/10.0)+370,320-mouseX*0.05,2*sin(frameCount/10.0)+360, 350-mouseX*0.05,2*sin(frameCount/10.0)+400,210-mouseX*0.05,2*sin(frameCount/10.0)+400); //some settings rectMode(CORNERS); ellipseMode(CENTER); fill(255, 255, 255); noStroke(); //***BUNNY*** //HEAD ellipse(148, 4*sin(frameCount/10.0)+130, 60, 60); ellipse(248, 4*sin(frameCount/10.0)+130, 60, 60); rect(148, 4*sin(frameCount/10.0)+100, 248, 4*sin(frameCount/10.0)+160); //EARS ellipse(143, 4*sin(frameCount/10.0)+100, 20, 120); ellipse(252, 4*sin(frameCount/10.0)+100, 20, 120); //DEAD EYES stroke(0); strokeWeight(2); line(145,133,155,123); line(145,123,155,133); line(240,133,250,123); line(240,123,250,133); //BODY fill(255); noStroke(); rect(170, 4*sin(frameCount/10.0)+159, 230, 4*sin(frameCount/10.0)+220); //torso ellipse(225, 4*sin(frameCount/10.0)+220, 10, 30); //leg ellipse(175, 4*sin(frameCount/10.0)+220, 10, 30); //leg //HALO noFill(); stroke(255,255,255,100); strokeWeight(2); ellipse(200,90,45,10); }