summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game/level.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-28 23:34:19 +0200
committerViljami Ilola <+@hix.fi>2024-03-28 23:34:19 +0200
commit27c7e16e4bd808ce1176f18b7a78c02ff4fa88ee (patch)
treea585d5ef853a0f8ffd5000cbdc9b0c4257163e53 /src/sliceitoff/game/level.py
parentf894c2fd09ed17540c49cb4083573861ded76554 (diff)
fonts under text, more sprite.Groups
Diffstat (limited to 'src/sliceitoff/game/level.py')
-rw-r--r--src/sliceitoff/game/level.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/sliceitoff/game/level.py b/src/sliceitoff/game/level.py
index f0bb871..ada29d2 100644
--- a/src/sliceitoff/game/level.py
+++ b/src/sliceitoff/game/level.py
@@ -16,16 +16,15 @@ class Level:
""" One level that can be played """
def __init__(self, display = None):
self.display = display
- self.ended = False
self.status = Status()
self.field = Field()
self.enemies = Enemies()
self.player = Player()
self.player_single = pygame.sprite.Group()
-
self.level_info = Show(level_screen())
- self.game_over = Show(gameover_screen(), active = False)
- self.levelup = Show(levelup_screen(), active = False)
+
+ self.ended = False
+ self.endscreen = pygame.sprite.Group()
self.gameplay = Gameplay(
player = self.player,
@@ -36,8 +35,6 @@ class Level:
self.status,
self.field,
self.enemies,
- self.game_over,
- self.levelup,
self.level_info]
def step(self, dt):
@@ -50,10 +47,8 @@ class Level:
self.level_info.update(dt = dt)
elif self.ended:
- if self.game_over.active:
- self.game_over.update(dt = dt)
- elif self.levelup.active:
- self.levelup.update(dt = dt)
+ if self.endscreen.active:
+ self.endscreen.update(dt = dt)
else:
return False
@@ -65,9 +60,10 @@ class Level:
self.player_single = pygame.sprite.Group()
self.ended = True
if Stats.lives:
- self.levelup.active = True
+ self.endscreen = Show(levelup_screen())
else:
- self.game_over.active = True
+ self.endscreen = Show(gameover_screen())
+ self.obj_classes.append(self.endscreen)
self.display.update(self.obj_classes+[self.player_single])