Hello everyone! I have completed the day/night system in a test room! It now must be put into the game, but that's as easy as dropping the object in the game room. It needs a bit of tweaking and I'm going to replace the sun and moon with proper sprites eventually. Here's what it looks like.
So, how does it work? There are a ton of different elements in within the day/night system that you probably would not have thought of.
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 this example, the proportion calculates that the sun should be at 90 degrees on the ellipse at 12:59 PM (780 raw time). It gets the position of the sun from a series of scripts.
The fading backgrounds was done very simply with a phase system. Phases are certain spans of time with specific backgrounds. There is a phase for every fading animation as well as static backgrounds. To get the fading effect, two images are stacked: the image to fade from and the image to fade to. The image to fade to starts with zero opacity and then increases to maximum opacity as time goes on. This system uses NO alarms and is very dynamic.
Until next time!
November's monthly task is to finish the inventory rewrite (Crevis) and to begin drafting levels (Nesus).
The author of the blog is Niften, or Sour Apple. He posts daily near the end of the day, usually before 11:00 PM.