/* Project name: "Rock Out!" Project type: "Interactive Drawing" Total shapes/lines: 43 Total lines of code: 151 (62 used for blanks/comments) Creator: Alex Durocher INSTRUCTIONS: Move the mouse around to make everybody rock out! FRED will follow the mouse with his eyes. The DJ will rock out with you. Click the left mouse button to blare the music. For music, I suggest the song "Boogie Down 5" available on Epidemic Sound. Another great choice is "Lone Digger" by Caravan Palace. */ void setup() { size(400, 400); } void draw() { // Background (# of shapes total) background(25); fill(11, 12, 52); stroke(11, 12, 52); // Floor (1) rectMode(CENTER); rect(200, 370, 400, 60); // DJ // DJ Table (2) fill(203, 51, 51); stroke(203, 51, 51); rect(312.5, 112.5, 125, 25); // DJ discs (5) fill(198); stroke(198); ellipse(343.75, 105, 45, 12.5); ellipse(281.25, 105, 45, 12.5); stroke(0); line(250, 112.5, 375, 112.5); // DJ head (6) fill(252, 231, 120); stroke(252, 231, 120); ellipse(312.5, 80, 50, 50); // DJ left hand (7) ellipse(348+(mouseY-300)*0.005, 92.5+(mouseY-300)*0.005, 25, 25); // DJ right hand (11) ellipse(270-(mouseX-300)*0.01, 60-(mouseY-300)*0.01, 25, 25); ellipse(279-(mouseX-300)*0.01, 51.25-(mouseY-300)*0.01, 6.5, 25); ellipse(261-(mouseX-300)*0.01, 48.75-(mouseY-300)*0.01, 5.2, 15); ellipse(283-(mouseX-300)*0.01, 57-(mouseY-300)*0.01, 7, 15); // DJ face (17) fill(0); stroke(0); line(300, 95, 325, 95); line(312, 100, 311, 90); line(305.5, 100, 305.5, 90); line(319, 100, 319, 87); ellipse(325, 74.5, 12.5, 12.5); ellipse(300, 80, 8, 8); // Decoration // Spotlight (20) fill(237, 245, 27, 191); stroke(237, 245, 27, 0); rect(200, 150, 200, 400); triangle(300, 0, 300, 350, 325, 350); triangle(100, 0, 100, 350, 75, 350); // Disco Ball (26) fill(225); stroke(200); ellipse(200, 0, 200, 100); fill(200); stroke(200); strokeWeight(3); line(200, 0, 200, 49); line(150, 0, 150, 41); line(250, 0, 250, 41); line(101, 4, 299, 4); line(116, 26, 283, 26); // FRED // Body (29) fill(70); stroke(70); strokeWeight(1); rect(200, 290, 100, 140); triangle(150, 360, 150, 220, 140, 360); triangle(250, 360, 250, 220, 260, 360); // Head (30) fill(252, 231, 120); stroke(252, 231, 120); ellipse(200+(mouseX-200)*0.01, 200, 125, 125); // Smile (31) fill(0); stroke(0); strokeWeight(3); line(180+(mouseX-200)*0.01, 225, 220+(mouseX-200)*0.01, 225); // Eyes (33) ellipse(175+(mouseX-200)*0.005, 185, 25, 25); ellipse(225+(mouseX-200)*0.005, 185, 25, 25); //Pupils (35) fill(255); stroke(255); strokeWeight(1); ellipse(175+(mouseX-200)*0.01, 185+(mouseY-200)*0.01, 2, 2); ellipse(225+(mouseX-200)*0.01, 185+(mouseY-200)*0.01, 2, 2); // Hands (37) fill(252, 231, 120); stroke(252, 231, 120); ellipse(300-(mouseX-200)*0.05, 250+(mouseX-200)*0.33, 50, 50); ellipse(100-(mouseX-200)*0.05, 250-(mouseX-200)*0.33, 50, 50); // Silhouettes // Bodies (41) fill(0); stroke(0); strokeWeight(1); rect(0, 290, 100, 130); triangle(50, 355, 50, 230, 60, 355); rect(425, 290, 100, 110); triangle(375, 345, 365, 345, 375, 235); // Heads (43) ellipse(0-(mouseX-300)*0.01, 210, 115, 115); ellipse(425-(mouseX-300)*0.01, 220, 115, 115); } void mousePressed(){ // Music fill(0); stroke(0); strokeWeight(3); }