Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/****************************************************************
          Starry Night by Halie Towns                          
 Interact with the drawing by quickly dragging your mouse      
 across the upper half of the image allowing shooting stars    
 to fill the sky. The girl that sits and watches will remark
 if you click the left mouse button!                                              
*****************************************************************/ 

void setup()
{
  size(400, 400); 
  //Draw background to fill remaining space
  background(240,159,156);
}

void draw()
{
//Draw night sky, each rect different colour for depth
  noStroke();
  rectMode(CENTER);
  fill(240, 159, 156);
  rect(mouseX / 50 + 200, mouseY / 50, 515, 515, 180);
  fill(99, 43, 108);
  rect(mouseX / 50 + 200, mouseY / 50, 500, 500, 180);
  fill(40, 15, 54);
  rect(mouseX / 50 + 200, mouseY / 50, 480, 480, 180);
  fill(30, 10, 41);
  rect(mouseX / 50 + 200, mouseY / 50, 420, 420, 180);

//Draw Stars in Sky aka too many
stroke(255);
strokeWeight(2);
point(mouseX / 91 + 43, mouseY / 93 + 48);
point(mouseX / 97 + 66, mouseY / 91 + 10);
point(mouseX / 92 + 88, mouseY / 96 + 77);
point(mouseX / 91 + 103, mouseY / 93 + 89);
point(mouseX / 97 + 125, mouseY / 91 + 66);
point(mouseX / 92 + 147, mouseY / 96 + 120);
point(mouseX / 91 + 169, mouseY / 93 + 79);
point(mouseX / 97 + 187, mouseY / 91 + 77);
point(mouseX / 92 + 210, mouseY / 96 + 17);
point(mouseX / 91 + 59, mouseY / 93 + 69);
point(mouseX / 97 + 243, mouseY / 91 + 109);
point(mouseX / 92 + 375, mouseY / 96 + 185);
point(mouseX / 91 + 177, mouseY / 93 + 138);
point(mouseX / 97 + 295, mouseY / 91 + 187);
point(mouseX / 92 + 101, mouseY / 96 + 168);
point(mouseX / 91 + 122, mouseY / 93 + 205);
point(mouseX / 97 + 189, mouseY / 91 + 21);
point(mouseX / 92 + 195, mouseY / 96 + 26);
point(mouseX / 91 + 166, mouseY / 93 + 95);
point(mouseX / 97 + 221, mouseY / 91 + 164);
point(mouseX / 92 + 184, mouseY / 96 + 98);
point(mouseX / 91 + 59, mouseY / 93 + 33);
point(mouseX / 97 + 77, mouseY / 91 + 203);
point(mouseX / 92 + 281, mouseY / 96 + 120);
point(mouseX / 91 + 256, mouseY / 93 + 61);
point(mouseX / 97 + 281, mouseY / 91 + 84);
point(mouseX / 92 + 149, mouseY / 96 + 49);
point(mouseX / 91 + 139, mouseY / 93 + 28);
point(mouseX / 97 + 37, mouseY / 91 + 188);
point(mouseX / 92 + 82, mouseY / 96 + 131);
point(mouseX / 91 + 137, mouseY / 93 + 47);
point(mouseX / 97 + 53, mouseY / 91 + 32);
point(mouseX / 92 + 171, mouseY / 96 + 199);
point(mouseX / 91 + 267, mouseY / 93 + 53);
point(mouseX / 97 + 367, mouseY / 91 + 47);
point(mouseX / 92 + 312, mouseY / 96 + 131);
point(mouseX / 91 + 368, mouseY / 93 + 33);
point(mouseX / 97 + 208, mouseY / 91 + 64);
point(mouseX / 92 + 239, mouseY / 96 + 100);
point(mouseX / 91 + 243, mouseY / 93 + 165);
point(mouseX / 97 + 332, mouseY / 91 + 66);
point(mouseX / 92 + 330, mouseY / 96 + 96);
point(mouseX / 91 + 253, mouseY / 93 + 213);
point(mouseX / 97 + 345, mouseY / 91 + 69);
point(mouseX / 92 + 243, mouseY / 96 + 42);
point(mouseX / 97 + 243, mouseY / 91 + 50);
point(mouseX / 92 + 288, mouseY / 96 + 23);
point(mouseX / 91 + 372, mouseY / 93 + 35);
point(mouseX / 97 + 371, mouseY / 91 + 37);
point(mouseX / 92 + 248, mouseY / 96 + 30);
point(mouseX / 97 + 40, mouseY / 91 + 72);
point(mouseX / 92 + 58, mouseY / 96 + 58);
point(mouseX / 91 + 82, mouseY / 93 + 43);
point(mouseX / 97 + 85, mouseY / 91 + 38);
point(mouseX / 92 + 78, mouseY / 96 + 31);
point(mouseX / 97 + 50, mouseY / 91 + 184);
point(mouseX / 92 + 23, mouseY / 96 + 110);
point(mouseX / 91 + 75, mouseY / 93 + 136);
point(mouseX / 97 + 65, mouseY / 91 + 122);
point(mouseX / 92 + 33, mouseY / 96 + 132);
point(mouseX / 97 + 30, mouseY / 91 + 129);
point(mouseX / 92 + 41, mouseY / 96 + 158);
point(mouseX / 91 + 26, mouseY / 93 + 143);
point(mouseX / 97 + 43, mouseY / 91 + 138);
point(mouseX / 92 + 31, mouseY / 96 + 131);

//Draw shooting star
  stroke(255);
  strokeWeight(2);
  line(pmouseX, pmouseY, mouseX, mouseY);

//Draw treeline bulk
  rectMode(CORNERS);
  noStroke();
  fill(0);
  rect(0, 250, 400, 320);

//Draw treeline tops
//1, first tip starting from left moving right
  triangle(0, 160, 20, 250, 0, 250);
  //2
  triangle(30, 200, 40, 250, 10, 250);
  //3
  triangle(50, 190, 75, 250, 30, 250);
  //4
  triangle(70, 200, 83, 250, 58, 250);
  //5
  triangle(90, 160, 100, 250, 70, 250);
  //6
  triangle(120, 190, 131, 250, 95, 250);
  //7
  triangle(130, 210, 140, 250, 120, 250);
  //8
  triangle(150, 200, 158, 250, 130, 250);
  //9
  triangle(170, 185, 180, 250, 150, 250);
  //10
  triangle(190, 160, 200, 250, 170, 250);
  //11
  triangle(205, 200, 215, 250, 195, 250); 
  //12
  triangle(240, 200, 250, 250, 215, 250);
  //13
  triangle(260, 190, 270, 250, 245, 250);
  //14
  triangle(280, 210, 290, 250, 270, 250);
  //15
  triangle(290, 230, 300, 250, 285, 250);
  //16
  triangle(300, 220, 310, 250, 290, 250);
  //17
  triangle(320, 205, 330, 250, 305, 250);
  //18
  triangle(335, 230, 345, 250, 325, 250);
  //19
  triangle(350, 215, 358, 250, 335, 250);
  //20
  triangle(365, 180, 370, 250, 350, 250);
  //21
  triangle(380, 190, 390, 250, 365, 250);
  //22
  triangle(400, 190, 400, 250, 390, 250);
  
    //Draw midGround 
  fill(8, 8, 8);
  noStroke();
  rectMode(CENTER);
  rect(200,360,400,80);
  
  //Draw Foreground ground
  fill(16,16,16);
  rect(200,360,400,40);
  fill(24,24,24);
  rect(200,380,400,40);
  
   //Stool for Foreground Girl
   rectMode(CORNERS);
  ellipse(265,330,25,5);
  ellipse(265,330,50,10);
  ellipse(265,335,50,10);
  rect(240,330,250,335);
  rect(280,330,290,335);
  rect(250,335,260,350);
  rect(270,335,280,350);
  
  //Draw Foreground Girl
  rectMode(CORNERS);
  fill(16,16,16);
  ellipse(265,320,30,20);
  triangle(265,280,280,320,250,320);
  fill(24,24,24);
  fill(8,8,8);
  ellipse(265,275,30,30);
  rect(250,275,280,310);
}
//Draw Foreground girl's reaction
void mousePressed()
{
  println("Look! A Shooting star!");
}