summaryrefslogtreecommitdiff
path: root/src/sliceitoff/player/player.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-23 18:42:26 +0200
committerViljami Ilola <+@hix.fi>2024-03-23 18:42:26 +0200
commitb03cb075e7a2042764a355a46d649b187f66343b (patch)
treef78e991650d33f7b1d9d8eab60f1e045da92d6c1 /src/sliceitoff/player/player.py
parent975e5dca49fb09fe2f762462f1c337c0d63735bf (diff)
Field as sprite group.
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r--src/sliceitoff/player/player.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py
index 2f4ce57..6e2ab0b 100644
--- a/src/sliceitoff/player/player.py
+++ b/src/sliceitoff/player/player.py
@@ -58,12 +58,7 @@ class Player():
if hitbox.colliderect(enemy.rect):
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)
+ self.field.kill_if_not_colliding(self.enemies.sprites)
return hit
def set_direction(self):