Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup () {
  size (400, 400);
}

void draw() {
  frameRate(30);
background(255);

  ///////
  //background art
  ///////

  //wall lines
  strokeWeight(3);
  stroke(0);
  line(70, 0, 70, 269);
  line(330, 0, 330, 269);
  line(70, 269, 0, 400);
  line(330, 270, 399, 400);
  line(329, 269, 70, 270);
  
  //////
  //various decorations
  //////
  
  //walls
  fill(203,198,178);
  rect(71,-2,257,270,0);
  quad(0,1,1,394,70,272,69,-1);
  quad(329,268,400,397,405,0,329,0);
  quad(328,272,404,409,3,398,70,271);
  
  //
  
  
  
  
  
  ///////////
  //tendrills:
  ////////////
  // the arms of the mosnter will follow the mous but always just out of its reach
  strokeWeight(4);

  //right arm 

  line (mouseX+104, mouseY+153, 324, 326);
  line (mouseX+104, mouseY+152, mouseX+66, mouseY+48);

  //left arm
  line (mouseX-104, mouseY+152, 76, 323);
  line (mouseX-104, mouseY+152, mouseX-66, mouseY+48);


  ///////////////////
  // base of bathtub
  ////////////////////
  fill(150);
  stroke(0);
  ellipse (100, 400, 150, 150);
  ellipse (150, 400, 150, 150);
  ellipse (200, 400, 150, 150);
  ellipse (250, 400, 150, 150);
  ellipse (300, 400, 150, 150);
  ellipse (306, 400, 80, 150);
  ellipse (306, 400, 0, 150);


  /////////////////
  //top of bath tub
  //////////////////
  fill(100, 100, 100);
  arc(200, 345, 300, 50, 0, HALF_PI+HALF_PI, OPEN); 
  arc(200, 345, 300, 60, PI, PI+PI, OPEN); 

  /////////////////
  // BASE OF MONSTER
  /////////////////

  fill(216, 185, 2);
  arc(200, 330, 250, 200, PI, PI+PI, OPEN);
  arc(200, 330, 250, 50, 0, HALF_PI+HALF_PI, OPEN); 

  /////
  //eye 
  //////
  // changes eye color based mouse postion
  fill (mouseX, (mouseX+mouseY), mouseY); 
  ellipse (200, 260, 50, 50);
  fill(0);
  ellipse (200, 250, 25, 25);

  /////////////
  //mouth
  //////////////
  fill(255, 0, 0);
  arc(200, 301, 112, 19, 0, HALF_PI+HALF_PI, OPEN); 
  arc(200, 301, 112, 19, PI, PI+PI, OPEN); 

  /////////////
  //teeth
  /////////////
  fill(255);
  strokeWeight(1);
  triangle (210, 308, 216, 297, 233, 306);
  triangle (188, 307, 199, 297, 210, 308);
  triangle (164, 306, 173, 298, 186, 307);
  triangle (157, 298, 151, 303, 164, 306);
  triangle (240, 299, 234, 306, 253, 303);
  triangle (173, 293, 186, 304, 193, 293);
  triangle (195, 293, 210, 303, 214, 293);
  triangle (239, 296, 233, 303, 214, 293);
  triangle (156, 297, 166, 301, 173, 294);
}
void mousePressed () {
  stroke(253, 1, 1);
  strokeWeight(22);
  line (200, 260, mouseX, mouseY);
}


/*

 
 *ABONADONED CODE LEFT FOR REFERNCE*
 
 
 // TENDRIL 1:
 //tendril 1 right side
 
 //right half of tendril (base)
 fill (216, 185, 2);
 curve(mouseX+150, mouseY+400, 325, 330, mouseX+80, mouseY+188, mouseX-200, mouseY+100);
 // middle part of right half
 noFill();
 curve(mouseX+190, mouseY+231, mouseX+80, mouseY+188, mouseX+78, mouseY+96, mouseX+135, mouseY+8);
 // tip of right half of tendril
 fill(216, 185, 2);
 curve(mouseX+8, mouseY+201, mouseX+78, mouseY+96, mouseX+46, mouseY+21, mouseX-95, mouseY+6);
/*
 // tendril 1 left section
 // base of left half
 noFill();
 curve(150, 412, 297, 332, mouseX+30, mouseY+173, mouseX-113, mouseY+76);
 // mid part of left half 
 fill(216, 185, 2);
 curve(mouseX+68, mouseY+190, mouseX+30, mouseY+173, mouseX+39, mouseY+109, mouseX+111, mouseY+18);
 // tip part of left half
 noFill();
 curve(mouseX-38, mouseY+191, mouseX+39, mouseY+109, mouseX+46, mouseY+21, mouseX-31, mouseY+6);
 
 //tendril 1 mid section 
 //base section of middle
 fill(216, 185, 2);
 curve(237, 383, 319, 332, mouseX+78, mouseY+210, mouseX-92, mouseY+155);
 // mid section of middle 
 noFill();
 curve(mouseX+116, mouseY+190, mouseX+78, mouseY+210, mouseX+57, mouseY+129, mouseX+150, mouseY+18);
 //tip of middle section
 curve(mouseX-38, mouseY+191, mouseX+57, mouseY+130, mouseX+47, mouseY+22, mouseX-31, mouseY+6);
 
 // this next section is for color filling of tendril one
 fill(216, 185, 2);
 noStroke();
 triangle (mouseX+30,mouseY+330,mouseX+55,mouseY+313,mouseX+62,mouseY+268); 
 
 */