Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/*  *-----------------------------*
    *                             *
    *      GET      SWOLE         *
    *                             *
    *-----------------------------*    
    
    **** BY JAMES PRATT *****
    
    **DESCRIPTION
  Clearly, I don't work out, I figured the second best thing
  I could do is make a drawing about working out while sitting on
  my butt, not working out. In this drawing, a little dude works out,
  in hopes of getting swole. Since he's a little wimp, any amount of
  workout will help him raise his swole, and if you still don't feel
  you're getting the most swole for your buck, clicking will make the
  dude say his catchphrase.
  
*/
//SETUP: gets all the specs for the drawing done first and once
void setup() {
//Setting up the canvas
size(400,400);
noStroke();
rectMode(CORNERS);
ellipseMode(CENTER);

}
//DRAW: makes all the assests and moves and resizes them around when the mouse moves upward
void draw() {
//draws the background
background(193,213,245);
//Poster
fill(255,255,255);
rect(30,60,80,130);
fill(222,45,42);
rect(40,70,70,90);

//Window
fill(255,255,255);
rect(230,30,400,160);
fill(201,245,255);
rect(240,40,400,150);

//Sun
fill(255,230,89);
ellipse(275,75,30,30);

//Buildings
fill(111,115,120,127);
rect(340,70,380,150);
fill(111,115,120);
rect(320,80,360,150);
rect(370,100,400,150);

//Floor
fill(163,149,126);
rect(0,300,400,400);

//draws the little dude

//chest
//What's happening: Dude's chest will get bigger as the user moves the mouse up
fill(70,148,59);
triangle(mouseY/8+100,mouseY/4+130,200,310,300-mouseY/8,mouseY/4+130);

//head and eyes
//What's happening: Head matches the upper side of the chest as the mouse moves up
fill(237,225,192);
ellipse(200,mouseY/4+90,80,80);
fill(0);
ellipse(180,mouseY/4+90,10,10);
ellipse(220,mouseY/4+90,10,10);

//Pants and legs
stroke(0);
strokeWeight(1.5);
line(170,320,170,370);
line(170,370,150,380);
line(229,320,229,370);
line(229,370,250,380);
noStroke();
fill(64,93,148);
rect(170,280,230,320);

//Left Arm
//What happening: When the mouse moves up, dude's arm goes up and gets bigger
fill(237,225,192);
ellipse(140,pmouseY/4+145,40+(height-mouseY)/6,30+(height-mouseY)/6);     
ellipse(100,pmouseY/2+70,40+(height-mouseY)/8,30+(height-mouseY)/8);

//Left Barbel
//What's happening: When the mouse moves up, the barbel matches the arms postion
fill(0);
ellipse(100,pmouseY/2+35,40,20);
ellipse(100,pmouseY/2+105,40,20);

//Right arm
//What's happening: Same as Left Arm
fill(237,225,192);
ellipse(260,pmouseY/4+145,40+(height-mouseY)/6,30+(height-mouseY)/6);
ellipse(300,pmouseY/2+70,40+(height-mouseY)/8,30+(height-mouseY)/8);

//Right Barbel
//What's happening: Same as Left Barbel
fill(0);
ellipse(300,pmouseY/2+35,40,20);
ellipse(300,pmouseY/2+105,40,20);

}
//MOUSE PRESSED: only happens when the user clicks the mouse
void mousePressed() {
  
  //No workout is complete without screaming. When the user clicks the mouse, Dude's trademark catchphrase is printed.
  println("Get Swole");
  
}