summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-18 17:12:48 +0200
committerViljami Ilola <+@hix.fi>2024-03-18 17:12:48 +0200
commitb219c4f736e6b98dd247064b362997576954f0ff (patch)
tree9714788ad78a39070c54869b59cf24b698ef4988 /src
parentc2432fdf4c3b60e579aef7e8a8a4f84e371f7734 (diff)
remove area after losing life
Diffstat (limited to 'src')
-rw-r--r--src/sliceitoff/player/player.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py
index 9870c50..241897d 100644
--- a/src/sliceitoff/player/player.py
+++ b/src/sliceitoff/player/player.py
@@ -48,17 +48,19 @@ class Player():
# self.lazer = True
# self.updated = True
hitbox = self.field.slice(self.position, self.direction, 4_500)
+ hit = False
if hitbox is not None:
for enemy in self.enemies.sprites:
if hitbox.colliderect(enemy.rect):
- return True
+ hit = True
+ break;
for field in self.field.sprites:
for enemy in self.enemies.sprites:
if enemy.rect.colliderect(field.rect):
break
else:
field.remove(self.field.sprites)
- return False
+ return hit
def set_direction(self):
if not self.lazer: