Added functionnal save system and broken load system

This commit is contained in:
eichhornchen
2020-11-16 01:01:18 +01:00
parent eca6b9af1f
commit f67eae3803
9 changed files with 204 additions and 26 deletions

View File

@@ -25,6 +25,8 @@ class Menu:
class MainMenuValues(Enum):
START = 'Jouer'
SAVE = 'Sauvegarder'
LOAD = 'Charger'
SETTINGS = 'Paramètres'
EXIT = 'Quitter'
@@ -35,23 +37,6 @@ class MainMenuValues(Enum):
class MainMenu(Menu):
values = [e for e in MainMenuValues]
def handle_key_pressed(self, key: KeyValues, game: Any) -> None:
"""
In the main menu, we can navigate through options.
"""
if key == KeyValues.DOWN:
self.go_down()
if key == KeyValues.UP:
self.go_up()
if key == KeyValues.ENTER:
option = self.validate()
if option == MainMenuValues.START:
game.state = GameMode.PLAY
elif option == MainMenuValues.SETTINGS:
game.state = GameMode.SETTINGS
elif option == MainMenuValues.EXIT:
sys.exit(0)
class SettingsMenu(Menu):
waiting_for_key: bool = False