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, 7 insertions, 7 deletions
diff --git a/src/sliceitoff/game/gameplay.py b/src/sliceitoff/game/gameplay.py
index 028536c..ef708c4 100644
--- a/src/sliceitoff/game/gameplay.py
+++ b/src/sliceitoff/game/gameplay.py
@@ -1,8 +1,6 @@
""" Reads user input and does actions when game play is on. """
import pygame
-from stats import Stats
-
class Gameplay:
""" Logic of the playfield """
def __init__(
@@ -10,11 +8,13 @@ class Gameplay:
player = None,
field = None,
status = None,
- enemies = None):
+ enemies = None,
+ stats = None):
self.status = status
self.player = player
self.field = field
self.enemies = enemies
+ self.stats = stats
def fire(self):
""" Lazer is fired. Actions to be taken. """
@@ -24,16 +24,16 @@ class Gameplay:
4_000)
if not zap_sprite:
return False
- Stats.add_score(-500)
+ self.stats.add_score(-500)
if pygame.sprite.spritecollideany(zap_sprite, self.enemies):
- if Stats.lose_life():
+ if self.stats.lose_life():
return True
self.field.kill_if_not_colliding(self.enemies.sprites())
self.field.update_stats()
- return Stats.percent < 20
+ return self.stats.percent < 20
def quit(self):
- Stats.lives = 0
+ self.stats.lives = 0
return True
def step(self):