Is this the right way to set up screens?
Posted: Wed Jan 25, 2017 6:40 pm
I'm creating a dating simulator and I'm trying to create the imagebutton and the screens but my code feels clunky wrong. I have it working so far but with a lot of hotfixes that shouldn't be there probably.
Is this code right or is there a better way to accomplish all of this?
P.S. What's the difference between calling a screen and showing one?
Is this code right or is there a better way to accomplish all of this?
Code: Select all
label homeroom:
hide b #Hot fix number one. Later in the game I show a character. I can't figure out how to hide this character properly. The only solution is hiding it in the main label. I definitely dont want to start each label by hiding every possible character.
if day == 0: # First Day
p "I should introduce myself to my classmates. I can't be a loner again..."
call screen homeroom_options
call screen homeroom_options
screen homeroom_options:
imagebutton: # simple imagebutton for a character. This is working as intended I'm pretty sure.
idle "buttons/bethanyg.png"
hover "buttons/bethanyh.png"
focus_mask True
action [Jump ("bethany")]
label bethany:
show b smile # This is where I show bethany but then am unable to hide her.
b "hey"
call screen bethany_options
return
screen bethany_options:
imagebutton:
idle "backgrounds/transparent.png"
action [Hide ("bethany_options"), Jump ("homeroom") ] #if the player clicks on not one of the options I jump back to homeroom where you can interact with a separate character. Is it possible to hide the "b smile" in this action?
imagebutton:
idle "boxes/talkg.png"
hover "boxes/talkh.png"
action [Hide ("bethany_options"), Jump ("talkbethany")]
xpos 500
ypos 850
imagebutton:
idle "boxes/flirtg.png"
hover "boxes/flirth.png"
action [Hide ("bethany_options"), Jump ("flirtbethany")]
xpos 800
ypos 850
imagebutton:
idle "boxes/giveg.png"
hover "boxes/giveh.png"
action [Hide ("bethany_options"), Jump ("flirtbethany")]
xpos 1100
ypos 850