Added functionnal save system and broken load system
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user