This program simulates day and night cycles by moving the mouse. Clicking starts the animation. It improves on the SunAndMoon lecture program by using the if statement to change between day and night once the sun has set.

Note: This demo requires a Java enabled browser. If you see this message then your browser either doesn't support Java or has had Java disabled.

Click below to download the source files for CelestialCycle.