This is my script code:
Code: Select all
# The script of the game goes in this file.
# Declare characters used by this game. The color argument colorizes the
# name of the character.
define e = Character("Eileen")
default Red = False
default Blue = False
image arrow_down = "down_arrow.png"
image arrow_up = "up_arrow.png"
image circle = "yellow_circle"
# The game starts here.
label start:
# Show a background. This uses a placeholder by default, but you can
# add a file (named either "bg room.png" or "bg room.jpg") to the
# images directory to show it.
scene bg room
# This shows a character sprite. A placeholder is used, but you can
# replace it by adding a file named "eileen happy.png" to the images
# directory.
show eileen happy
# These display lines of dialogue.
e "You've created a new Ren'Py game."
e "Once you add a story, pictures, and music, you can release it to the world!"
hide eileen
show circle at truecenter
"This is to test the key statement"
"choose"
window hide
show screen keyscreen
show screen arrowscreen
pause
if Blue == True:
image circle = "blue_circle"
elif Red == True:
image circle = "red_circle"
window show
"The game ends"
pause
# This ends the game.
return
Code: Select all
screen keyscreen():
key "K_UP" action (SetVariable("Blue", True), Hide('keyscreen'), Hide('arrowscreen'))
key "K_DOWN" action (SetVariable("Red", True), Hide('keyscreen'), Hide('arrowscreen'))
screen arrowscreen():
vbox:
xalign 0.8
yalign 0.5
spacing 50
imagebutton idle "up_arrow" action NullAction()
imagebutton idle "down_arrow" action NullAction()
Then the screen is shown
The colour should have changed here(the colour should have been yellow from the start but even if it was red, it should have changed into blue if I had clicked the up arrow but it didn't)