//Window by Melissa Goldsmith //the scene shows the sun and moon rising and setting through a window //move the mouse left to make the moon set and the sun rise //move the mouse right to make the sun set and the moon rise //press the mouse during the day to make the berries flash //press the mouse at night to make the stars flash void setup() { //set total size to 400x400 size(400, 400); } void draw() { //set to 60 fps frameRate(60); //set back wall to light beige background(255, 245, 230); rectMode(CORNERS); //widow pt.1(edge of frame) stroke(255); fill(255); rect(90, 40, 300, 260); //sky fill(0, 0, 51); rect(100, 50, 290, 250); //stars noStroke(); fill(250, 250, 240); ellipse(280, 90, 5, 5); ellipse(150, 80, 5, 5); ellipse(125, 67, 5, 5); ellipse(200, 143, 5, 5); ellipse(260, 156, 5, 5); ellipse(140, 230, 5, 5); ellipse(198, 224, 5, 5); ellipse(220, 75, 5, 5); ellipse(237, 220, 5, 5); ellipse(110, 90, 5, 5); ellipse(112, 134, 5, 5); ellipse(132, 167, 5, 5); //day sky original colour(135,26,235) fill(135, 206, 235, mouseX); rect(100, 50, 290, 250); //sun fill(244, 240, 90); ellipse(190, -mouseX+490, 70, 70); //moon fill(250, 250, 250); ellipse(190, mouseX+90, 60, 60); //window pt.2 (rest of frame and glass) fill(255); rect(100, 250, 290, 260); fill(255, 255, 255, 40); rect(100, 140, 290, 200); rect(100, 50, 290, 200); fill(255); rect(100, 195, 290, 200); rect(100, 137, 290, 140); //wall under window fill(255, 245, 230); noStroke(); rect(100, 260, 300, 300); //floor fill(101, 67, 33); rect(0, 310, 400, 400); fill(255); rect(0, 310, 400, 300); //tabel fill(204, 119, 34); rect(85, 265, 105, 350); rect(315, 265, 295, 350); stroke(294, 209, 124); strokeWeight(3); fill(255, 255, 255, 200); ellipse(195, 265, 410, 10); //flower pot noStroke(); fill(151, 153, 111); rect(75, 245, 89, 265); rect(300, 245, 316, 265); //bush fill(23, 203, 23); ellipse(83, 220, 50, 59); ellipse(310, 220, 50, 59); //berries fill(234, 0, 14); ellipse(70, 210, 12, 12); ellipse(95, 215, 7, 7); ellipse(90, 230, 10, 10); ellipse(69, 232, 8, 8); ellipse(305, 210, 9, 9); ellipse(325, 220, 7, 7); ellipse(302, 230, 12, 12); ellipse(323, 235, 6, 6); } void mousePressed() { //set to 10fps frameRate(10); //redraw everything exept change star colour background(255, 245, 230); rectMode(CORNERS); //widow pt.1 stroke(255); fill(255); rect(90, 40, 300, 260); //sky //night fill(0, 0, 51); rect(100, 50, 290, 250); //flash stars noStroke(); fill(255, 0, 0); ellipse(280, 90, 5, 5); ellipse(150, 80, 5, 5); ellipse(125, 67, 5, 5); ellipse(200, 143, 5, 5); ellipse(260, 156, 5, 5); ellipse(140, 230, 5, 5); ellipse(198, 224, 5, 5); ellipse(220, 75, 5, 5); ellipse(237, 220, 5, 5); ellipse(110, 90, 5, 5); ellipse(112, 134, 5, 5); ellipse(132, 167, 5, 5); //day sky 135,26,235 noStroke(); fill(135, 206, 235, mouseX); rect(100, 50, 290, 250); //sun fill(244, 240, 90); ellipse(190, -mouseX+490, 70, 70); //moon fill(250, 250, 250); ellipse(190, mouseX+90, 60, 60); //window pt.2 fill(255); rect(100, 250, 290, 260); fill(255, 255, 255, 40); rect(100, 140, 290, 200); rect(100, 50, 290, 200); fill(255); rect(100, 195, 290, 200); rect(100, 137, 290, 140); //wall under window fill(255, 245, 230); noStroke(); rect(100, 260, 300, 300); //floor fill(101, 67, 33); rect(0, 310, 400, 400); fill(255); rect(0, 310, 400, 300); //tabel fill(204, 119, 34); rect(85, 265, 105, 350); rect(315, 265, 295, 350); stroke(294, 209, 124); strokeWeight(3); fill(255, 255, 255, 200); ellipse(195, 265, 410, 10); //flower pot noStroke(); fill(151, 153, 111); rect(75, 245, 89, 265); rect(300, 245, 316, 265); //bush fill(23, 203, 23); ellipse(83, 220, 50, 59); ellipse(310, 220, 50, 59); //berries fill(234, 0, 14); ellipse(70, 210, 12, 12); ellipse(95, 215, 7, 7); ellipse(90, 230, 10, 10); ellipse(69, 232, 8, 8); ellipse(305, 210, 9, 9); ellipse(325, 220, 7, 7); ellipse(302, 230, 12, 12); ellipse(323, 235, 6, 6); //flash berries stroke(23, 0, 200, mouseX -65); fill(0, 0, 245, mouseX-65); ellipse(70, 210, 12, 12); ellipse(95, 215, 7, 7); ellipse(90, 230, 10, 10); ellipse(69, 232, 8, 8); ellipse(305, 210, 9, 9); ellipse(325, 220, 7, 7); ellipse(302, 230, 12, 12); ellipse(323, 235, 6, 6); }