//Tristan Szakacs //project0 part deux float horizon; float sunX, sunY; color night = color( 255); color day = color( 200, 200, 0); void setup() { size( 800, 800); horizon= height/4; } void draw() { sky(); sun(); } //Method to create the sky. void sky() { if( sunX < (width * 0.65)) background( 50, 100, 200); if( sunX > (width * 0.65)) background(50, 100, 125); } //Method to create the Sun. void sun() { ellipseMode(CENTER); fill( day); ellipse( (float) sunX, sunY, 90, 90); sunX= (sunX + 1) % (width+100)-0.5; sunY= horizon-20 - 0.75 * horizon * sin( PI * sunX/width ); stroke(1); if( sunX > (width * 0.65)) day = night; if( sunX < (width * 0.65)) day = color(200, 200, 0); }