Time

The day/night system correlates with the time. Time is a value between 0-1440. There's one minute to an hour, making each day 24 hours. 1440 is the amount of seconds in a day. I will be referring to the numeric value of time (0-1440) as "raw time."

A proportion calculates the angle of the sun based on the raw time. The sun is then drawn on the ellipse at that angle.

In GameMaker, the functions lengthdir_x and lengthdir_y exist. These functions are used to find a specific point at a specific length and angle. This may sound complicated, but think about it as finding a point on a circle's circumference given the radius and the angle. With the day/night system, there's one problem... it's not a circle - it's an ellipse. An ellipse's radius is always changing. So, I needed an equation to get the ellipse's radius at any given time. I found a formula that did just this. |

Until next time!