import pygame, sys def rotate(surface,angle): rotated_surface = pygame.transform.rotozoom(surface,angle,1) rotated_rect = rotated_surface.get_rect(center = (300,300)) return rotated_surface,rotated_rect pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode([600,600]) pikachu = pygame.image.load("pikachu.png") angle = 0 pikachu_rect = pikachu.get_rect(center= (300,300)) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() angle += 1 screen.fill((225,225,225)) pikachu_rotated,pikachu_rotated_rect = rotate(pikachu,angle) screen.blit(pikachu_rotated,pikachu_rotated_rect) pygame.display.flip() clock.tick(30)