diff options
Diffstat (limited to 'src/sliceitoff/game')
-rw-r--r-- | src/sliceitoff/game/gameplay.py | 14 | ||||
-rw-r--r-- | src/sliceitoff/game/level.py | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/sliceitoff/game/gameplay.py b/src/sliceitoff/game/gameplay.py index cc20c3b..6296a5a 100644 --- a/src/sliceitoff/game/gameplay.py +++ b/src/sliceitoff/game/gameplay.py @@ -5,14 +5,22 @@ from stats import Stats class Gameplay: """ Logic of the playfield """ - def __init__(self, player = None, field = None, status = None): + def __init__( + self, + player = None, + field = None, + status = None, + enemies = None): self.status = status self.player = player self.field = field + self.field = enemies def fire(self): - if self.player.fire_lazer() and Stats.lose_life(): - return True + if self.player.fire_lazer(): + field.kill_if_not_colliding(enemies.sprites()) + if Stats.lose_life(): + return True return Stats.percent < 20 def quit(self): diff --git a/src/sliceitoff/game/level.py b/src/sliceitoff/game/level.py index e5dc9f6..a417d8f 100644 --- a/src/sliceitoff/game/level.py +++ b/src/sliceitoff/game/level.py @@ -31,7 +31,7 @@ class Level: self.display.update( ( self.status.sprites, self.field, - self.enemies.sprites, + self.enemies, self.player.sprites) ) if self.gameplay.step(): |