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)) pump = pygame.image.load('pump.png') pump_rect = pump.get_rect(center= (300,300)) angle = 0 pygame.mixer.init() click_sound = pygame.mixer.Sound("shot.mp3") while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() elif event.type == pygame.MOUSEBUTTONDOWN and event.button == 1: click_sound.play() angle += 1 screen.fill((255,255,255)) pump_rotated,pump_rotated_rect = rotate(pump,angle) screen.blit(pump_rotated,pump_rotated_rect) pygame.display.flip() clock.tick(144)