I have a switch in a game I'm trying to make which turns on and off a screen for the date/time and another for the amount of money the player has to display in the top left and top right corners respectively. The code however does not appear to be working as nothing happens when I run the game and get to the point the game switches the date/time switch on and the player cash switch to on.
Instead I just see the background, the character in front, and the text box.
When I run the game the switches are switched from off to on and I have tested with them just starting in the on position but that did not resolve either.
Starting code is and the screen button code below are both under the screens.rpy file.
Code: Select all
$ day_button_switch = False
$ credit_button_switch = False
Code: Select all
label normal_day:
$ day_button_switch = True
$ credit_button_switch = True
n "This is a normal day."
Code: Select all
screen button:
if day_button_switch:
vbox xalign 0.0 yalign 0.0:
frame:
vbox:
text "[month] [current_day], [current_year], [current_weekday]"
text "[hour]:[minute] [ampm] - [current_time]"
if credit_button_switch:
vbox xalign 1.0 yalign 0.0:
frame:
has vbox
text "$ [player_cash]"
My full screens.rpy init code pertaining to these two items and some additional stuff.
Code: Select all
init:
$ day_button_switch = False
$ credit_button_switch = False
$ month = "August"
$ current_year = 2022
$ current_date = 1
$ current_weekday = "Monday"
$ season = 1
$ hero_history = 0
$ leap_year = False
$ hour = 6
$ minute = 00
$ ampm = "am"
$ current_time = "Early Morning"
$ player_cash = 0