def handle_vertical_collision(player, objects, dy):
collided_objects = []
for obj in objects:
if pygame.sprite.collide_mask(player, obj):
if dy > 0:
player.rect.bottom = obj.rect.top
player.landed()
elif dy < 0:
player.rect.top = obj.rect.bottom
player.hit_head()
collided_objects.append(obj)
return collided_objects()
on the fourth line with pygame.sprite…. it gives a error exactly stating : “‘NoneType’ object has no attribute ‘overlap'” im so confused because i followed the video the exact same. Also this code is supposed to allow for a character to collide with the blocks on the ground when the characters falls from the spawn area (half way in the sky) but instead of landing on the blocks it goes right through