summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game/gameplay.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-04-08 21:03:40 +0300
committerViljami Ilola <+@hix.fi>2024-04-08 21:03:40 +0300
commit9548295de1d343e831baaa2e1c908f70cef0e33a (patch)
treee9cb817de24b179beb842ec356e542ce22cde086 /src/sliceitoff/game/gameplay.py
parentc99a7138e78352c4e26483dd4dad36b009a72e4f (diff)
life group. indicator for lost life
Diffstat (limited to 'src/sliceitoff/game/gameplay.py')
-rw-r--r--src/sliceitoff/game/gameplay.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sliceitoff/game/gameplay.py b/src/sliceitoff/game/gameplay.py
index 5a14767..49ff026 100644
--- a/src/sliceitoff/game/gameplay.py
+++ b/src/sliceitoff/game/gameplay.py
@@ -8,11 +8,13 @@ class Gameplay:
player = None,
field = None,
enemies = None,
- stats = None):
+ stats = None,
+ life = None):
self.player = player
self.field = field
self.enemies = enemies
self.stats = stats
+ self.life = life
def fire(self):
""" Lazer is fired. Actions to be taken. """
@@ -24,6 +26,7 @@ class Gameplay:
return False
self.stats.add_score(-500)
if pygame.sprite.spritecollideany(zap_sprite, self.enemies):
+ self.life.lose_life()
if self.stats.lose_life():
return True
self.field.kill_if_not_colliding(self.enemies.sprites())