So I have a list of rectangles (bricks) and I'm trying to make it collide with the ball_rect: When I execute the code, it gives me the error: "TypeError: Argument must be a sequence of objects."
bricks = [brick := Brick(6, 450, brick_width,brick_height,0), #I've made a function for those
brick := Brick(76, 450, brick_width,brick_height,0)]
for BRICK in bricks:
brick_rect = pygame.Rect(BRICK.x, BRICK.y, brick.width, BRICK.height) #
pygame.draw.rect(screen, LEVELS[BRICK.level], brick_rect)
if ball_rect.collideobjects(BRICK): #When I do so, I have the error stated above
yVel *= -1