Better idea

This commit is contained in:
2026-04-17 18:29:24 -04:00
parent bc7716a894
commit d84ed0c792

16
game.py
View File

@@ -35,10 +35,18 @@ class Game:
return False return False
def options_menu(self): def options_menu(self):
options = ["Back"]
if not os.path.exists("WEB_VERSION"):
options[0:0] = [ # AI came up with this, what the heck is [0:0]
"Save",
"Save and quit",
"Settings",
"Quit",
]
while True: while True:
match ui.select( match ui.select(
"Please choose an option", "Please choose an option",
["Save", "Save and quit", "Quit", "Settings", "Back"], options,
): ):
case "Save": case "Save":
data.save.save(self.cat) data.save.save(self.cat)
@@ -116,9 +124,11 @@ class Game:
print(f"{self.cat.name} says bye") print(f"{self.cat.name} says bye")
return return
options = ["New Game", "Quit"] options = ["New Game"]
if os.path.exists("saves") and not os.path.exists("WEB_VERSION"): if os.path.exists("saves") and not os.path.exists("WEB_VERSION"):
options.insert(0, "Load Game") options.insert(0, "Load Game")
if not os.path.exists("WEB_VERSION"):
options.append("Quit")
print("Welcome to Whiskerbound!") print("Welcome to Whiskerbound!")
choice = ui.select("Please choose an option", choices=options) choice = ui.select("Please choose an option", choices=options)
@@ -137,5 +147,3 @@ class Game:
if __name__ == "__main__": if __name__ == "__main__":
game = Game() game = Game()
game.run() game.run()
if os.path.exists("WEB_VERSION"):
print("You have quit the game, please reload the page to play again.")