I am attempting to create a car game to practice AI training utilising N.E.A.T. The following is the draw function from inside the Car class:
def draw(self, win):
rotated_img = pygame.transform.rotate(self.img, self.angle)
rotated_rect = rotated_img.get_rect(center=(self.x, self.y))
win.blit(rotated_img, rotated_rect.topleft)
This code returns the following error:
line 18, in draw
rotated_rect = rotated_img.get_rect(center=(self.x, self.y))
TypeError: invalid rect assignment
It appears to be an error with the get_rect method however I am unsure as to what is the information or type it is requesting.