overlaps_rect-Methode entfernt

This commit is contained in:
binaerverkehr 2026-09-26 13:26:39 +02:00
parent 8bc852c29d
commit 10df1d884a

18
game.py
View file

@ -123,24 +123,6 @@ class Game:
else:
self.color_item = (0, 0, 0)
def overlaps_rect(self, rect):
nearest_x = self.x
if self.x < rect.left:
nearest_x = rect.left
elif self.x > rect.right:
nearest_x = rect.right
nearest_y = self.y
if self.y < rect.top:
nearest_y = rect.top
elif self.y > rect.bottom:
nearest_y = rect.bottom
dx = self.x - nearest_x
dy = self.y - nearest_y
distance_squared = dx * dx + dy * dy
return distance_squared < self.radius * self.radius
class Player:
def __init__(self, game, pos: pygame.Vector2, width, height):