diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-23 18:42:26 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-23 18:42:26 +0200 |
commit | b03cb075e7a2042764a355a46d649b187f66343b (patch) | |
tree | f78e991650d33f7b1d9d8eab60f1e045da92d6c1 /src/sliceitoff/player/player.py | |
parent | 975e5dca49fb09fe2f762462f1c337c0d63735bf (diff) |
Field as sprite group.
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r-- | src/sliceitoff/player/player.py | 7 |
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): |