Your browser does not support the canvas tag.

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

void draw()
{
  frameRate(60);
  background(255, 137, 50);


  //sun reflection
  fill(255, 166, 76);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 330, 220);
  fill(255, 191, 103);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 185, 185);
  fill(254, 212, 126);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 110, 110);
  fill(255, 229, 154);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 65, 65);
  fill(255, 242, 181);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 50, 50);
  fill(253, 249, 204);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 40, 40);
  fill(255, 255, 255);
  rect(135 + mouseX/ 2, 400 - mouseY/4, 30, 30);

  //sun
  fill(255, 166, 76);
  rect(135 + mouseX / 2, 40 + mouseY/4, 330, 330);
  fill(255, 191, 103);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 185, 185);
  fill(254, 212, 126);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 110, 110);
  fill(255, 229, 154);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 65, 65);
  
  //Sun dim
  fill(250,83,23,mouseY/5 - 10);
  rect(200,200,400,400);
  
  //sun part 2
  fill(255, 242, 181);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 50, 50);
  fill(253, 249, 204);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 40, 40);
  fill(255, 255, 255);
  rect(135 + mouseX/ 2, 40 + mouseY/4, 30, 30);

  //sun glare
  fill(255, 80);
  rect(150 + mouseX / 2.5, 70 + mouseY/4.2, 20, 20);
  rect(165 + mouseX / 3, 90 + mouseY/4.4, 10, 10);
  rect(190 + mouseX / 4.55, 150 + mouseY/8, 5, 5);

  //mountain reflection
  fill(76, 59, 31);
  rect(45-mouseX/100, 350, 10, 10);
  rect(45-mouseX/100, 340, 30, 10);
  rect(45-mouseX/100, 330, 50, 10);
  rect(45-mouseX/100, 320, 70, 10);
  rect(45-mouseX/100, 310, 90, 10);
  fill(50, 44, 10);
  rect(45-mouseX/100, 340, 10, 10);
  rect(45-mouseX/100, 330, 30, 10);
  rect(45-mouseX/100, 320, 50, 10);
  rect(45-mouseX/100, 310, 70, 10);
  rect(45-mouseX/100, 300, 90, 10);
  fill(26, 24, 0);
  rect(35-mouseX/100-mouseX/20, 310 - mouseY/100, 10, 10);
  rect(35-mouseX/100-mouseX/20, 300 - mouseY/100, 30, 10);

  // mountain reflection #2
  fill(76, 59, 31);
  rect(120-mouseX/100, 350, 10, 10);
  rect(120-mouseX/100, 340, 30, 10);
  rect(120-mouseX/100, 330, 50, 10);
  rect(120-mouseX/100, 320, 70, 10);

  fill(50, 44, 10);
  rect(120-mouseX/100, 340, 10, 10);
  rect(120-mouseX/100, 330, 30, 10);
  rect(120-mouseX/100, 320, 50, 10);
  rect(120-mouseX/100, 310, 70, 10);

  //lake tint
  fill(255, 150, 60, 90);
  rect(170, 330, 350, 50);


  //mountain back layer
  fill(76, 59, 31);
  rect(45-mouseX/100, 90, 10, 10);
  rect(45-mouseX/100, 100, 30, 10);
  rect(45-mouseX/100, 110, 50, 10);
  rect(45-mouseX/100, 120, 70, 10);
  rect(45-mouseX/100, 130, 90, 10);
  rect(45-mouseX/100, 140, 110, 10);
  rect(45-mouseX/100, 150, 130, 10);
  rect(45-mouseX/100, 160, 150, 10);
  rect(45-mouseX/100, 170, 170, 10);
  rect(45-mouseX/100, 180, 190, 10);
  rect(45-mouseX/100, 190, 210, 10);
  rect(45-mouseX/100, 200, 230, 10);
  rect(45-mouseX/100, 210, 250, 10);
  rect(45-mouseX/100, 220, 270, 10);
  rect(45-mouseX/100, 230, 290, 10);
  rect(45-mouseX/100, 240, 310, 10);


  //mountain middle layer
  fill(50, 44, 10);
  rect(45-mouseX/100, 100, 10, 10);
  rect(45-mouseX/100, 110, 30, 10);
  rect(45-mouseX/100, 120, 50, 10);
  rect(45-mouseX/100, 130, 70, 10);
  rect(45-mouseX/100, 140, 90, 10);
  rect(45-mouseX/100, 150, 110, 10);
  rect(45-mouseX/100, 160, 130, 10);
  rect(45-mouseX/100, 170, 150, 10);
  rect(45-mouseX/100, 180, 170, 10);
  rect(45-mouseX/100, 190, 190, 10);
  rect(45-mouseX/100, 200, 210, 10);
  rect(45-mouseX/100, 210, 230, 10);
  rect(45-mouseX/100, 220, 250, 10);
  rect(45-mouseX/100, 230, 270, 10);
  rect(45-mouseX/100, 240, 290, 10);
  rect(45-mouseX/100, 250, 310, 10);
  rect(45-mouseX/100, 260, 330, 10);

  //mountain front layer (shadow)
  fill(26, 24, 0);
  //moving shadow
  rect(35-mouseX/100-mouseX/20, 130 - mouseY/100, 10, 10);
  rect(35-mouseX/100-mouseX/20, 140 - mouseY/100, 30, 10);
  rect(35-mouseX/100-mouseX/20, 150 - mouseY/100, 50, 10);
  rect(45-mouseX/100-mouseX/20, 160 - mouseY/100, 70, 10);
  rect(45-mouseX/100, 160, 90, 10);
  rect(45-mouseX/100, 170, 130, 10);
  rect(45-mouseX/100, 180, 150, 10);
  rect(45-mouseX/100, 190, 170, 10);
  rect(45-mouseX/100, 200, 190, 10);
  rect(45-mouseX/100, 210, 210, 10);
  rect(45-mouseX/100, 220, 230, 10);
  rect(45-mouseX/100, 230, 250, 10);
  rect(45-mouseX/100, 240, 270, 10);
  rect(45-mouseX/100, 250, 290, 10);

  //mountain # 2
  fill(76, 59, 31);
  rect(120-mouseX/100, 90, 10, 10);
  rect(120-mouseX/100, 100, 30, 10);
  rect(120-mouseX/100, 110, 50, 10);
  rect(120-mouseX/100, 120, 70, 10);
  rect(120-mouseX/100, 130, 90, 10);
  rect(120-mouseX/100, 140, 110, 10);
  rect(120-mouseX/100, 150, 130, 10);
  rect(120-mouseX/100, 160, 150, 10);
  rect(120-mouseX/100, 170, 170, 10);
  rect(120-mouseX/100, 180, 190, 10);

  //mountain middle layer
  fill(50, 44, 10);
  rect(120-mouseX/100, 100, 10, 10);
  rect(120-mouseX/100, 110, 30, 10);
  rect(120-mouseX/100, 120, 50, 10);
  rect(120-mouseX/100, 130, 70, 10);
  rect(120-mouseX/100, 140, 90, 10);
  rect(120-mouseX/100, 150, 110, 10);
  rect(120-mouseX/100, 160, 130, 10);
  rect(120-mouseX/100, 170, 150, 10);
  rect(120-mouseX/100, 180, 170, 10);
  rect(120-mouseX/100, 190, 190, 10);
  rect(120-mouseX/100, 200, 210, 10);
  rect(120-mouseX/100, 210, 230, 10);
  rect(120-mouseX/100, 220, 250, 10);
  rect(120-mouseX/100, 230, 270, 10);
  rect(120-mouseX/100, 240, 290, 10);
  rect(120-mouseX/100, 250, 310, 10);
  rect(120-mouseX/100, 260, 330, 10);

  //mountain front layer (shadow)
  fill(26, 24, 0);
  //moving shadow
  rect(110-mouseX/100-mouseX/25, 130 - mouseY/100, 10, 10);
  rect(110-mouseX/100-mouseX/25, 140 - mouseY/100, 30, 10);
  rect(110-mouseX/100-mouseX/30, 150 - mouseY/100, 50, 10);
  rect(110-mouseX/100-mouseX/40, 160 - mouseY/100, 70, 10);
  rect(120-mouseX/100-mouseX/40, 170 - mouseY/100, 90, 10);

  rect(120-mouseX/100, 170, 130, 10);
  rect(120-mouseX/100, 180, 150, 10);
  rect(120-mouseX/100, 190, 170, 10);
  rect(120-mouseX/100, 200, 190, 10);
  rect(120-mouseX/100, 210, 210, 10);
  rect(120-mouseX/100, 220, 230, 10);
  rect(120-mouseX/100, 230, 250, 10);
  rect(120-mouseX/100, 240, 270, 10);
  rect(120-mouseX/100, 250, 290, 10);
  rect(10-mouseX/100, 210, 90, 70);

  //mountain #3 middle layer
  fill(50, 44, 10);
  rect(310-mouseX/100, 170, 10, 10);
  rect(310-mouseX/100, 180, 30, 10);
  rect(310-mouseX/100, 190, 50, 10);
  rect(310-mouseX/100, 200, 70, 10);
  rect(310-mouseX/100, 210, 90, 10);
  rect(310-mouseX/100, 220, 110, 10);
  rect(310-mouseX/100, 230, 130, 10);
  rect(310-mouseX/100, 240, 150, 10);
  rect(310-mouseX/100, 250, 170, 10);
  rect(310-mouseX/100, 260, 190, 10);
  rect(310-mouseX/100, 270, 210, 10);
  rect(310-mouseX/100, 280, 230, 30);

  //mountain # 3 front layer (shadow)
  fill(26, 24, 0);
  rect(320-mouseX/100-mouseX/25, 210-mouseY/25, 10, 10);
  rect(320-mouseX/100-mouseX/25, 220-mouseY/25, 30, 10);
  rect(320-mouseX/100-mouseX/25, 230-mouseY/25, 50, 10);
  rect(320-mouseX/100-mouseX/25, 240-mouseY/25, 70, 10);
  rect(320-mouseX/100-mouseX/25, 250-mouseY/25, 90, 10);
  rect(320-mouseX/100-mouseX/25, 260-mouseY/25, 110, 10);
  rect(320-mouseX/100-mouseX/25, 270-mouseY/25, 130, 10);
  rect(320-mouseX/100-mouseX/25, 280-mouseY/25, 150, 10);
  rect(320-mouseX/100-mouseX/25, 290-mouseY/25, 170, 10);

  //Lake dirt
  fill(63, 52, 20);
  rect(200-mouseX/20, 380, 500, 50);
  rect(380-mouseX/20, 370, 200, 50);
  rect(400-mouseX/20, 360, 100, 50);
  rect(420-mouseX/20, 350, 100, 50);
  rect(340-mouseX/20, 320, 140, 10);
  rect(340-mouseX/20, 320, 140, 10);
  rect(200-mouseX/20, 310, 300, 10);
  rect(150-mouseX/20, 300, 300, 10);
  fill(63, 52, 20, 100);
  rect(200-mouseX/20, 380, 520, 50);
  rect(380-mouseX/20, 370, 220, 50);
  rect(400-mouseX/20, 360, 120, 50);
  rect(420-mouseX/20, 350, 120, 50);
  rect(340-mouseX/20, 320, 160, 10);
  rect(340-mouseX/20, 320, 160, 10);
  rect(200-mouseX/20, 310, 320, 10);
  rect(150-mouseX/20, 300, 320, 10);

  //brown dirt
  fill(76, 61, 30);
  rect(200-mouseX/20, 390, 500, 10);
  rect(400-mouseX/20, 370, 100, 10);
  rect(420-mouseX/20, 360, 100, 10);
  rect(420-mouseX/20, 350, 100, 10);
  rect(380-mouseX/20, 310, 140, 10);
  rect(260-mouseX/40, 300, 300, 10);
  rect(150-mouseX/40, 290, 300, 10);
  rect(200-mouseX/20, 400, 500, 50);
  rect(200-mouseX/40, 290, 400, 10);
  rect(180-mouseX/40, 280, 360, 10);
  rect(140-mouseX/40, 270, 350, 10);
  rect(140-mouseX/40, 250, 190, 10);
  rect(160-mouseX/40, 240, 130, 10);


  //Light dirt
  fill(90, 70, 45);
  rect(200-mouseX/20, 410, 500, 50);
  rect(210-mouseX/40, 280, 320, 10);
  rect(300-mouseX/40, 290, 200, 10);
  rect(300-mouseX/40, 300, 80, 10);
  rect(140-mouseX/40, 270, 300, 10);
  rect(140-mouseX/40, 260, 320, 10);
  fill(90, 70, 45, 100);
  rect(200-mouseX/20, 410, 520, 50);
  rect(210-mouseX/40, 280, 340, 10);
  rect(300-mouseX/40, 290, 220, 10);
  rect(300-mouseX/40, 300, 100, 10);
  rect(140-mouseX/40, 270, 320, 10);

  


  //bird head
  fill(255);
  triangle(mouseX, mouseY, mouseX-10, 5+mouseY, 10+mouseX, 5+mouseY);       

  //bird body
  rect(mouseX, 10+mouseY, 20, 10);                       

  //bird left wing
  triangle(mouseX-30, mouseY, mouseX-10, mouseY+5, mouseX-10, mouseY+15);          
  triangle(mouseX-40, mouseY+10, mouseX-10, mouseY+10, mouseX-30, mouseY);        
  triangle(mouseX-40, mouseY+10, mouseX-30, mouseY, mouseX-60, mouseY);          
  triangle(mouseX-40, mouseY+10, mouseX-60, mouseY, mouseX-60, mouseY+5);          
  triangle(mouseX-70, mouseY-5, mouseX-60, mouseY, mouseX-60, mouseY+5);          

  //bird right wing
  triangle(mouseX+10, mouseY+5, mouseX+10, mouseY+15, mouseX+30, mouseY);        
  triangle(mouseX+10, mouseY+10, mouseX+30, mouseY, mouseX+40, mouseY+10);         
  triangle(mouseX+30, mouseY, mouseX+40, mouseY+10, mouseX+60, mouseY);         
  triangle(mouseX+40, mouseY+10, mouseX+60, mouseY, mouseX+60, mouseY+5);       
  triangle(mouseX+60, mouseY, mouseX+60, mouseY+5, mouseX+70, mouseY-5);        

  //bird tail
  rect(mouseX, 18+mouseY, 20, 8);                        
  triangle(mouseX-10, mouseY+15, mouseX-10, mouseY+23, mouseX-20, mouseY+25);        
  triangle(mouseX-10, mouseY+22, mouseX,    mouseY+25, mouseX+10, mouseY+22);          
  triangle(mouseX+10, mouseY+15, mouseX+10, mouseY+23, mouseX+20, mouseY+25);

  //clouds
  fill(255, 90);
  rect(10 + mouseX, 40, 30, 10);
  rect(20 + mouseX, 50, 80, 10);
  rect(20 + mouseX, 60, 100, 10);

  rect(10 + mouseX, 40, 30, 10);
  rect(20 + mouseX, 50, 80, 10);
  rect(20 + mouseX, 60, 100, 10);

  rect(190 + mouseX/1.2, 20, 10, 10);
  rect(200 + mouseX/1.2, 30, 80, 10);
  rect(200 + mouseX/1.2, 40, 120, 10);

  rect(mouseX - 180/1.1, 40, 40, 10);
  rect(mouseX - 200/1.1, 50, 100, 10);
  rect(mouseX - 200/1.1, 60, 120, 10);


}
//fire surrounds bird
  void mousePressed() {
  frameRate(20);
  fill(255,110,20,50);
  rect(mouseX, mouseY+10, 100, 50);
  rect(mouseX, mouseY+10, 50, 100);
  rect(mouseX, mouseY+10, 70, 70);
  rect(mouseX, mouseY+10, 35, 35);
  rect(mouseX, mouseY+10, 120, 10);
  rect(mouseX, mouseY+10, 10, 120);
  }