From b03cb075e7a2042764a355a46d649b187f66343b Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 23 Mar 2024 18:42:26 +0200 Subject: Field as sprite group. --- src/sliceitoff/player/player.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/sliceitoff/player/player.py') 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): -- cgit v1.2.3