feat: add collisions
This commit is contained in:
@@ -46,3 +46,9 @@ class Track:
|
||||
def render(self, surf: pygame.Surface, camera: Camera):
|
||||
for object in self.objects:
|
||||
object.render(surf, camera)
|
||||
|
||||
def get_collision_polygons(self) -> list[list[Vec]]:
|
||||
polygons: list[list[Vec]] = []
|
||||
for obj in self.objects:
|
||||
polygons.extend(obj.get_collision_polygons())
|
||||
return polygons
|
||||
|
||||
Reference in New Issue
Block a user