From 20b23c0cd4cf613a2634cc57bf6f2430cc9fc364 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sun, 31 Mar 2024 13:47:27 +0300 Subject: Mainmenu selector sprite group --- src/sliceitoff/game/game.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sliceitoff/game/game.py') diff --git a/src/sliceitoff/game/game.py b/src/sliceitoff/game/game.py index b7d5212..18c47b2 100644 --- a/src/sliceitoff/game/game.py +++ b/src/sliceitoff/game/game.py @@ -11,6 +11,7 @@ from text import Fonts from stats import Stats from screens import welcome_screen, hiscores_screen from hiscores import HiScores +from mainmenu import Mainmenu from .level import Level from .show import Show @@ -63,8 +64,17 @@ class Game: self.display.update([initials]) return initials.name + def mainmenu(self): + """ menu where one select what to do """ + menu = Mainmenu() + while menu.active: + menu.update(dt = self.clock.tick()) + self.display.update([menu]) + return menu.selection + def run(self): """ This is the main loop of the game (not loop at the moment) """ + self.mainmenu() self.welcome() self.newgame() if self.hiscores.high_enough(self.stats.score): -- cgit v1.2.3