From acfac65f17a274d6d7f73cb44ed9476032241134 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 30 Mar 2024 13:04:39 +0200 Subject: lint, refactor, doc, repeat --- src/sliceitoff/game/level.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/sliceitoff/game/level.py') diff --git a/src/sliceitoff/game/level.py b/src/sliceitoff/game/level.py index 26df345..0742213 100644 --- a/src/sliceitoff/game/level.py +++ b/src/sliceitoff/game/level.py @@ -20,7 +20,6 @@ class Level: self.field = Field(stats = self.stats) self.enemies = Enemies(count = self.stats.enemies) self.player = Player() - self.player_single = pygame.sprite.Group() self.level_info = Show(level_screen(stats.level)) self.ended = False @@ -28,7 +27,6 @@ class Level: self.gameplay = Gameplay( player = self.player, - status = self.status, field = self.field, enemies = self.enemies, stats = self.stats) @@ -36,7 +34,8 @@ class Level: self.status, self.field, self.enemies, - self.level_info] + self.level_info, + self.player] def step(self, dt): self.status.update(dt = dt) @@ -53,11 +52,8 @@ class Level: return False else: - self.player_single = pygame.sprite.GroupSingle( - sprite = self.player.get_top_sprite()) self.stats.update_bonus(dt) if self.gameplay.step(): - self.player_single = pygame.sprite.Group() self.ended = True if self.stats.lives: self.endscreen = Show(levelup_screen(self.stats)) @@ -65,6 +61,6 @@ class Level: self.endscreen = Show(gameover_screen()) self.obj_classes.append(self.endscreen) - self.display.update(self.obj_classes+[self.player_single]) + self.display.update(self.obj_classes) return True -- cgit v1.2.3