Error pygame: Argument must be a sequence of rectstyle objects

Viewed 62

Hi I'm trying to make a simple 2d car game with pygame and I'm trying to add collisions between two cars, but i keep getting this error:

Traceback (most recent call last):
  File "C:\Users\emilio pinto\Desktop\Running car proj\Running car.py", line 69, in <module>
    if pygame.Rect.collidelist(car1,car2) >= 0:
TypeError: Argument must be a sequence of rectstyle objects.

I'm pretty sure that i've been using the .Rect module good, anyway these are the variables and how i'm trying to use them:


car1=pygame.Rect((xCar, yCar), (60, 30))
car2=pygame.Rect((xCar2, yCar2), (60, 30))

    if pygame.Rect.collidelist(car1,car2) >= 0:
        running=False
        screen.fill((0,0,0))
        screen.blit(loseText, (142, 90))
        screen.blit(loseText2,(110, 170))
        pygame.display.flip()
        if keys[pygame.K_SPACE]:
            running=True
            continue
1 Answers
Related