Relative Content

Tag Archive for pythonclassmethodsattributeerrornonetype

I keep getting a weird attribute error despite following a pygame tutorial I need help trying to fix this error

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 […]