//And more CubeLove...i hope you enjoy //With random color in center cube, on Click change Cube //Click or drag over the points change bg color //Click on th right part of the canvas change bg in black // Backspace key reset the canvas // s Key save a screenshot //Global Variables float x=0; //setup() void setup(){ size(880,720); colorMode(HSB); background(x/300,200,255); } //draw() void draw(){ noStroke(); if (mousePressed){ beginShape(); if ((mouseX>= 0) && (mouseX<=80) && (mouseY>= 320) && (mouseY<= 700)) { background(#333333); } if ((mouseX>= 80) && (mouseX<=160) && (mouseY>= 320) && (mouseY<= 700)) { background(#666666); } if ((mouseX>= 160) && (mouseX<=240) && (mouseY>= 320) && (mouseY<= 700)) { background(#999999); } if ((mouseX>= 240) && (mouseX<=320) && (mouseY>= 320) && (mouseY<= 700)) { background(#cccccc); } if ((mouseX>= 320) && (mouseX<=480) && (mouseY>= 320) && (mouseY<= 700)) { background(#ffffff); } if ((mouseX>= 480) && (mouseX<=800) && (mouseY>= 0) && (mouseY<= 720) && (mousePressed == true)) { background(0); } fill(x/200,200,255); x+=20; //points smooth(); fill(#333333); ellipse(20, 360, 30, 30); fill(#666666); ellipse(100, 360, 20, 20); fill(#999999); ellipse(180, 360, 10, 10); fill(#cccccc); ellipse(260, 360, 5, 5); fill(#ffffff); ellipse(340, 360, 2, 2); //center cube fill(x/100,200,300); quad(400,320,440,340,440,400,400,380); fill(#dcdcdc); quad(400,320,440,300,480,320,440,340); fill(#035155); quad(440,340,480,320,480,380,440,400); //small cube fill(x/100,200,300); quad(454,320,466,327,466,341,454,334); fill(#035155); quad(440,327,454,320,454,334,454,334); fill(#000000); quad(454,334,466,341,454,348,454,334); if ((mouseX>= 400) && (mouseX<=480) && (mouseY>= 320) && (mouseY<= 400) && (mousePressed == true)) { fill(300,200,255); quad(400,320,440,340,440,400,400,380); fill(#000000); quad(400,320,440,300,480,320,440,340); fill(#dcdcdc); quad(440,340,480,320,480,380,440,400); } endShape(); } } //key Pressed() void keyReleased(){ if (key==DELETE || key==BACKSPACE) background(0); if (key=='s' || key=='S') saveFrame("screenshot.png"); }