Hi, absolute beginner to coding here, learning from scratch and would appreciate some input
I've been reading a lot about different time system approaches and studied the code for a few games. I know how I want to handle it, just not sure how the code would go.
What I want to do is have the days of the week correspond to numbers 1-7 (or 0-6 if that's better?). I.e. something like day 1 = Monday for future display purposes. I can probably do this with define or if statements, but is there a more direct solution? Like saying 1-7 = monday, tuesday etc.
I want each day to have 3 phases corresponding to numbers 1-3 (or 0-2 if it's better). Like time 1 = Morning, time 2 = Afternoon, time 3 = Evening. Same question as above.
The way I imagine this working is that I would trigger a +1 to the time count after each event or with a time skip button. Meaning I'd put something like $ time += 1 after every event that's supposed to advance time.
Now comes what's probably the tricky part: How can I make it so that the max possible number for time is 3 and if it passes the number it loops back to 1? Plus, how do I make it so that each time it loops back it adds +1 to day? (I'm assuming I can use the same method to loop the days when they reach a max value of 7. )
P. S. I plan to trigger events at locations based on if/else checks related to time and day values.
I've been reading a lot about different time system approaches and studied the code for a few games. I know how I want to handle it, just not sure how the code would go.
What I want to do is have the days of the week correspond to numbers 1-7 (or 0-6 if that's better?). I.e. something like day 1 = Monday for future display purposes. I can probably do this with define or if statements, but is there a more direct solution? Like saying 1-7 = monday, tuesday etc.
I want each day to have 3 phases corresponding to numbers 1-3 (or 0-2 if it's better). Like time 1 = Morning, time 2 = Afternoon, time 3 = Evening. Same question as above.
The way I imagine this working is that I would trigger a +1 to the time count after each event or with a time skip button. Meaning I'd put something like $ time += 1 after every event that's supposed to advance time.
Now comes what's probably the tricky part: How can I make it so that the max possible number for time is 3 and if it passes the number it loops back to 1? Plus, how do I make it so that each time it loops back it adds +1 to day? (I'm assuming I can use the same method to loop the days when they reach a max value of 7. )
P. S. I plan to trigger events at locations based on if/else checks related to time and day values.