import pygame, sys def rotate(surface, angle, scale=1.1): rotated_surface = pygame.transform.rotozoom(surface, angle, scale) 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)) frog = pygame.image.load('attack_1.png') frog_rect = frog.get_rect(center=[300, 300]) angle = 0 while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() angle += 1 screen.fill((255, 255, 255)) frog_rotated, frog_rotated_rect = rotate(frog, angle) screen.blit(frog_rotated, frog_rotated_rect) pygame.display.flip() clock.tick(30)