- Oct 25, 2019
- 21
- 65
I'm doing it like this, it's very specific to my needs and I'm sure other ways to do it are better, but I thought I'd throw in my two cents. Can't hurt.
The "tod" variable is set whenever the code advances the time of day to "morning" "afternoon" or "night", by jumping to their respective label.
"Weekday" is called whenever the code jumps to "morning".
I like to save locations, weekdays and such things as strings, so I can just call them with []. I could have done the same for the tod variable, but that's a relic from earlier on in development.
I'm very inexperienced and still learning.
Python:
label sleep:
$ day += 1
jump morning
screen time():
text "{color=#FFFFFF}Day [day] ([weekday]){/color}" xpos 680 ypos 20 size 24
if tod == 0:
text "{color=#FFFFFF}Morning{/color}" xpos 920 ypos 20 size 24
elif tod == 1:
text "{color=#FFFFFF}Afternoon{/color}" xpos 920 ypos 20 size 24
else:
text "{color=#FFFFFF}Night{/color}" xpos 920 ypos 20 size 24
label weekday:
if weekday == "Saturday":
$ weekday = "Sunday"
elif weekday == "Sunday":
$ weekday = "Monday"
elif weekday == "Monday":
$ weekday = "Tuesday"
elif weekday == "Tuesday":
$ weekday = "Wednesday"
elif weekday == "Wednesday":
$ weekday = "Thursday"
elif weekday == "Thursday":
$ weekday = "Friday"
elif weekday == "Friday":
$ weekday = "Saturday"
return
"Weekday" is called whenever the code jumps to "morning".
I like to save locations, weekdays and such things as strings, so I can just call them with []. I could have done the same for the tod variable, but that's a relic from earlier on in development.
I'm very inexperienced and still learning.