I am making a game in Pygame and I want it so every time the sprite jumps it rotates mid-air and lands on its side. A lot like Geometry Dash jumping if you have ever played that. I have some code but it won't rotate.
This is my player class
class Player(pygame.sprite.Sprite): def __init__(self, color, x, y, width, height): super().__init__() self.color = color self.image = pygame.Surface([width, height]) self.image.fill(color) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y
and this is my code to rotate
while running: if keys[pygame.K_SPACE]: pygame.transform.rotate(player.image, 45) isjump = True v = jump_v