Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
//Seashore
//Mermaid sitting on a rock by the seaside. On mouse down, tail moves. Move mouse up and down to comb the mermaid's hair and movr the tides.
//Leann Sterling

void setup() 
{
  size(400, 400);
  rectMode(CENTER);
  ellipseMode(CORNERS);
  noStroke();
}

void draw() 
{

  //sky
  background(212, 230, 252);

  //clouds
  fill(255, 255, 255, 150);
  ellipse(175, 10, 255, 60);
  ellipse(220, 35, 295, 80);
  ellipse(295, 75, 360, 110);
  ellipse(255, 95, 325, 135);
  ellipse(215, 120, 280, 145);

  //shore
  fill(250, 246, 230);
  rect(200, 300, 400, 200);

  //main water
  fill(54, 193, 255);
  rect(260, 200, 280, 100);

  //moving water
  fill(54, 193, 255, 200);
  rect(350, mouseY+80, 800, 200);

  //small shore
  fill(250, 246, 230);
  triangle(150, 155, 120, 190, 210, 190);
  ellipse(133, 153, 170, 175);
  ellipse(165, 165, 177, 177);

  //tree
  fill(48, 162, 81);
  ellipse(-40, 30, 155, 225);
  ellipse(-40, -20, 165, 85);

  ellipse(135, -5, 150, 10);

  ellipse(160, 20, 170, 35);
  ellipse(159, 28, 170, 40);

  ellipse(145, 52, 157, 65);

  ellipse(125, 77, 157, 92);
  ellipse(134, 90, 155, 110);
  ellipse(138, 100, 153, 111);

  ellipse(145, 145, 160, 157);
  ellipse(145, 156, 157, 170);
  ellipse(140, 165, 155, 180);
  ellipse(135, 173, 150, 188);

  ellipse(110, 195, 127, 213);

  //behind rock, remove later
  ellipse(90, 213, 102, 225);
  ellipse(80, 213, 92, 227);

  ellipse(45, 220, 58, 233);
  ellipse(37, 220, 50, 233);
  ellipse(28, 218, 40, 230);
  ellipse(18, 213, 31, 225);

  ellipse(3, 208, 15, 220);
  ellipse(-5, 200, 8, 217);

  //smaller branches
  fill(166, 139, 106);
  triangle(95, 180, 115, 140, 106, 180);
  triangle(95, 135, 110, 155, 107, 162);

  triangle(13, 160, 25, 200, 40, 200);

  //darker leaves
  fill(11, 135, 125);
  ellipse(80, 120, 125, 150);
  ellipse(85, 140, 100, 155);
  ellipse(120, 130, 130, 140);

  ellipse(3, 145, 40, 180);
  ellipse(0, 165, 12, 178);
  ellipse(25, 142, 35, 152);
  ellipse(30, 147, 44, 160);

  //rocks
  fill(143, 153, 171);
  rect(70, 308, 140, 185);

  fill(128, 137, 153);
  ellipse(-30, 200, 23, 240);
  ellipse(12, 207, 52, 245);
  ellipse(112, 210, 150, 248);

  fill(143, 153, 171);
  rect(173, 330, 45, 140);

  fill(128, 137, 153);
  ellipse(170, 247, 205, 279);

  fill(71, 76, 85);
  rect(108, 338, 125, 125);

  fill(89, 96, 107);
  ellipse(35, 265, 65, 295);
  ellipse(108, 267, 135, 295);
  ellipse(125, 270, 155, 293);
  ellipse(147, 265, 175, 290);

  //mermaid
  fill(217, 183, 121);
  triangle(109, 190, 85, 190, 85, 220);

  fill(248, 232, 210);
  rect(94, 208, 3, 7);
  rect(105, 239, 4, 58);
  ellipse(83, 211, 110, 230);
  ellipse(83, 173, 103, 207);
  triangle(78, 210, 105, 210, 94, 250);
  triangle(94, 242, 80, 270, 105, 270);

  fill(22, 127, 57);
  triangle(90, 250, 76, 275, 134, 305);
  triangle(121, 294, 134, 305, 95, 335);

  fill(151, 237, 138);
  ellipse(75, 315, 100, 335);
  ellipse(96, 325, 115, 353);
  triangle(80, 317, 87, 335, 55, 340);
  triangle(98, 330, 110, 352, 75, 360);

  fill(248, 232, 210);
  triangle(108, 265, 103, 265, 104, 275);
  triangle(103, 263, 105, 265, 100, 272);

  fill(217, 183, 121);
  ellipse(90, 170, 110, 195);
  ellipse(76, 170, 98, 210);
  rect(85, 229, 17, 72);

  fill(201, 40, 62);
  rect(mouseX+12, mouseY, 4, 15);

  fill(248, 232, 210);
  rect(mouseX, mouseY, 22, 4);
}

void mousePressed() 
{
  frameRate(10);

  //rock
  fill(71, 76, 85);
  rect(108, 338, 125, 125);

  fill(89, 96, 107);
  ellipse(35, 265, 65, 295);
  ellipse(108, 267, 135, 295);
  ellipse(125, 270, 155, 293);
  ellipse(147, 265, 175, 290);

  //tail
  fill(22, 127, 57);
  triangle(90, 250, 76, 275, 160, 345);
  fill(151, 237, 138);
  ellipse(138, 340, 162, 365);
  ellipse(160, 333, 183, 357);
  triangle(137, 353, 162, 353, 153, 380);
  triangle(150, 345, 183, 345, 187, 370);

  //hand
  fill(248, 232, 210);
  triangle(108, 265, 103, 265, 104, 275);
  triangle(103, 263, 105, 265, 100, 272);

  //hair
  fill(217, 183, 121);
  rect(85, 229, 17, 72);
}