diff options
Diffstat (limited to 'src/sliceitoff/game/level.py')
-rw-r--r-- | src/sliceitoff/game/level.py | 20 |
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]) |