float sunX = 0; float sunY = 0; float moonX =0; float moonY = 0; float sealevel; float birdX = 600; boolean button = true; void setup() { size (600,500); sealevel= height/4; fill(255,0,0); ellipse (20,20,400,400); } void draw() { if (button) { scene(); sun(); borderSquare(); bird(); button(); birdX=birdX-3; if (birdX < 0) { birdX = 600; } } else { darkScene(); borderSquare(); button(); moon(); moonX=moonX+1; } } void scene() { //day background(145,220,255); noStroke(); fill(0,180,10); rect(0,sealevel,800,600); if (sunX > width) { sunX = 0; sunY = random (20, sealevel-20); } sunX= sunX+1; } void darkScene() { //night background(0,50,180); noStroke(); fill(0,180,120); rect(0,sealevel,800,600); if (moonX > width) { moonX = 0; moonY = random (20, sealevel-20); } moonX= moonX+1.5; } void moon() { noStroke(); fill(160,20,50); ellipse(moonX+40,45,60,60); } void sun() { noStroke(); fill(255,255,0); ellipse(sunX+45,45,60,60); } void bird() { //bird moving noStroke(); fill(180,20,180); triangle(birdX,80,birdX,100,birdX-30,90); triangle(birdX+15,65,birdX+15,115,birdX-10,90); } void button() { //button that changes time textSize(12); fill(240,250,120); text("Butt Button", 35,450); stroke(0); noFill(); rect(20,425,90,50); } void borderSquare() { for (float y=0; y= 20 && mouseX <= 90 && mouseY >= 400 && mouseY <= 450) { button = !button; } }