summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game/game.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-31 13:47:27 +0300
committerViljami Ilola <+@hix.fi>2024-03-31 13:47:27 +0300
commit20b23c0cd4cf613a2634cc57bf6f2430cc9fc364 (patch)
tree8c997e4f2b961a94e2eacf9593a9134b2bd0776e /src/sliceitoff/game/game.py
parentab9ba6bd09a3b8a3ee89656b099f8f1c002c7f06 (diff)
Mainmenu selector sprite group
Diffstat (limited to 'src/sliceitoff/game/game.py')
-rw-r--r--src/sliceitoff/game/game.py10
1 files changed, 10 insertions, 0 deletions
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):