summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game/gameplay.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/game/gameplay.py')
-rw-r--r--src/sliceitoff/game/gameplay.py14
1 files changed, 11 insertions, 3 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):