Slowly turning a rectangle in pygame
问题 I have some code: mouseX, mouseY = pygame.mouse.get_pos() angle = math.degrees(math.atan2(mouseY - self.rect.centery, mouseX - self.rect.centerx)) rotated = pygame.transform.rotate(self.rect, -angle) self.rect = lol.get_rect() How should I modify this code to slowly turn the rectangle depending on the mouse angle (10deg/s etc.)? Edit: I want to rotate CLASS object (based on pygame.sprite.Sprite class) 回答1: Just don't rotate your image to the target angle, but only a little bit until you reach