Modified main menu to be able to override the current game with a new one

This commit is contained in:
Charles Peyrat
2020-11-13 18:08:48 +01:00
parent eca6b9af1f
commit ae493337ed
3 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,8 @@ class Menu:
class MainMenuValues(Enum):
START = 'Jouer'
START = 'Nouvelle partie'
RESUME = 'Continuer'
SETTINGS = 'Paramètres'
EXIT = 'Quitter'
@ -46,6 +47,9 @@ class MainMenu(Menu):
if key == KeyValues.ENTER:
option = self.validate()
if option == MainMenuValues.START:
game.new_game()
game.state = GameMode.PLAY
elif option == MainMenuValues.RESUME:
game.state = GameMode.PLAY
elif option == MainMenuValues.SETTINGS:
game.state = GameMode.SETTINGS