Load save

This commit is contained in:
2026-04-11 17:52:27 -04:00
parent 6b23548b26
commit 13c701dfe9

12
game.py
View File

@@ -3,6 +3,7 @@ from systems.ui import clear, title
from systems.world import shelter, house
import systems.ui as ui
import data.save
import os
class Game:
@@ -44,11 +45,20 @@ class Game:
def run(self):
title()
options = ["New Game", "Quit"]
if os.path.exists("saves"):
options.insert(0, "Load Game")
print("Welcome to Whiskerbound!")
choice = ui.select("", choices=["New Game", "Quit"])
choice = ui.select("Please choose an option", choices=options)
if choice == "New Game":
self.new_game()
elif choice == "Load Game":
save = "saves/" + ui.select(
"Please choose a savefile to load", os.listdir("saves")
)
self.cat = data.save.load(save)
self.game_loop()
elif choice == "Quit":
quit()