From 447ebdd5a88bc57438864ff8647c87cba5e5531c Mon Sep 17 00:00:00 2001 From: Yan Wittmann Date: Tue, 28 Mar 2023 17:17:51 +0200 Subject: [PATCH] Another attempt at optimization --- project/physics/PhysicsElementsHandler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/project/physics/PhysicsElementsHandler.py b/project/physics/PhysicsElementsHandler.py index dc13ca1..0b565c9 100644 --- a/project/physics/PhysicsElementsHandler.py +++ b/project/physics/PhysicsElementsHandler.py @@ -167,8 +167,7 @@ class PhysicsElementsHandler: for collider in colliders: if sprite is not collider: distance = self.calculate_basic_distance(sprite, collider) - if distance > max(self.get_sprite_size_for_distance(sprite, screen_transform), - self.get_sprite_size_for_distance(collider, screen_transform)): + if distance > 50: continue if sprite.collides_with(collider, TOLERANCE): collides_with.append(collider)