From 5db9b7c6276f3cbbedfdeda41042873d9d5cf7c9 Mon Sep 17 00:00:00 2001 From: Yan Wittmann Date: Mon, 27 Mar 2023 14:47:12 +0200 Subject: [PATCH] Minor performance improvement --- project/physics/PhysicsElementsHandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/physics/PhysicsElementsHandler.py b/project/physics/PhysicsElementsHandler.py index e3a135a..5d13720 100644 --- a/project/physics/PhysicsElementsHandler.py +++ b/project/physics/PhysicsElementsHandler.py @@ -163,5 +163,7 @@ class PhysicsElementsHandler: if sprite is not collider: if sprite.collides_with(collider, TOLERANCE): collides_with.append(collider) + if len(collides_with) >= 2: + break return collides_with