From d64c6b122eacd7b33bbda3a62093b492c786b1f9 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 27 Apr 2024 16:03:08 +0300 Subject: refactor menus --- src/sliceitoff/game/game.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/sliceitoff/game/game.py') diff --git a/src/sliceitoff/game/game.py b/src/sliceitoff/game/game.py index 57f2c56..e25a6a6 100644 --- a/src/sliceitoff/game/game.py +++ b/src/sliceitoff/game/game.py @@ -17,7 +17,7 @@ from sliceitoff.hiscores import hi_scores from sliceitoff.text import fonts from sliceitoff.sfx import sfx -from .mainmenu import Mainmenu, MenuItems +from .mainmenu import MainMenu, MainMenuItems from .level import Level from .show import Show from .initials import Initials @@ -76,7 +76,7 @@ class Game: def mainmenu(self): """ menu where one select what to do """ sfx.music("pimpelipompeli") - menu = Mainmenu() + menu = MainMenu() while menu.active: menu.update(dt = self.clock.tick()) self.display.update([menu]) @@ -93,17 +93,17 @@ class Game: """ This is the main loop of the game """ while True: match self.mainmenu(): - case MenuItems.QUIT: + case MainMenuItems.QUIT: hi_scores.save() settings.save() break - case MenuItems.HISCORES: + case MainMenuItems.HISCORES: self.show_highscores() - case MenuItems.INSTRUCT: + case MainMenuItems.INSTRUCT: self.instructions() - case MenuItems.SETTINGS: + case MainMenuItems.SETTINGS: self.settings() - case MenuItems.NEWGAME: + case MainMenuItems.NEWGAME: self.newgame() if hi_scores.high_enough(self.stats.score): hi_scores.add( self.stats.score, self.initials()) -- cgit v1.2.3