I want to create a main menu where a new imagebutton is added after each ending. I understand how to use the $ persistent.ending == "" code to get the main menu screen to change, but I'm stuck on how I can make it so that the main menu screen itself stays the same, but a new imagebutton is added once you get a certain ending, and then how to make each one appear as you collect them.
Currently, all that is happening is one of the imagebuttons will appear after each ending, but I would like for them to add up as you collect each ending instead of replace each other. So instead of just showing the imagebutton for ending 1 after ending 1 is complete, and then switching to a different imagebutton for ending 2 once you play through again, I would like for both ending 1 and ending 2's imagebuttons to be present at the same time.
I'd appreciate any help, or if you can direct me to a thread that already deals with this! Also please, if possible, give detailed descriptions with coded visuals, because I am new to this and am learning as I go.
Here is the code for my main menu screen:
Code: Select all
screen main_menu():
# This ensures that any other menu screen is replaced.
tag menu
imagemap:
ground "menu/mainmenu_bg.png"
idle "menu/mainmenu_idle.png"
hover "menu/mainmenu_hover.png"
hotspot (253,472,227,69) action Start() hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/StylishPiano.mp3"
hotspot (274,552,221,71) action ShowMenu("load") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
hotspot (88,260,95,36) action ShowMenu("preferences") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
hotspot (248,230,75,39) action ShowMenu("about") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
hotspot (387,201,93,45) action Help() hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
if persistent.ending == "Henry Good End": # This checks wether the variable for game completion is true or not. If yes, it will change the main menu.
imagebutton auto "menu/henryendingkeychain_%s.png" xpos 1038 ypos 170 action ShowMenu("henry_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
elif persistent.ending == "Ned Good End":
imagebutton auto "menu/nedendingkeychain_%s.png" xpos 1074 ypos 188 action ShowMenu("ned_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
elif persistent.ending == "Frank Good End":
imagebutton auto "menu/frankendingkeychain_%s.png" xpos 959 ypos 188 action ShowMenu("frank_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
elif persistent.ending == "Joe Good End":
imagebutton auto "menu/joeendingkeychain_%s.png" xpos 869 ypos 188 action ShowMenu("joe_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
elif persistent.ending == "":
add "menu/blank.png"
Code: Select all
label test_run:
n norm "Here is a test to see if this is going to work. Choose the ending you want."
menu pick_an_ending:
x "What ending do I want?"
"Frank's":
$ persistent.ending = "Frank Good End"
return
"Ned's":
$ persistent.ending = "Ned Good End"
return
"Joe's":
$ persistent.ending = "Joe Good End"
return
"Henry's":
$ persistent.ending = "Henry Good End"
return
Code: Select all
if persistent.ending == "Henry Good End" and "Ned Good End":
imagebutton auto "menu/henryendingkeychain_%s.png" xpos 1038 ypos 170 action ShowMenu("henry_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
imagebutton auto "menu/nedendingkeychain_%s.png" xpos 1074 ypos 188 action ShowMenu("ned_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"