I’m working on adding an in-game clock, and the basic logic is pretty simple:
seconds += DeltaTime;
if (seconds >= 60){
seconds = 0;
minute += 1;
if (minute > 60){
minute = 0;
hour += 1;
if (hour > 23){
hour = 0;
}
}
}
This gives me the real-world passage of time, but where I’m conceptually stuck is how to convert it to in-game units. I have some int DayInMinutes which indicates how long, in real-world minutes, 24 in-game hours should take, but what’s the most efficient way to actually multiply the clock’s behavior based on this?