Aug-24-2021, 09:46 PM
Is something like this going to work for you?
import random, pygame, sys from pygame.locals import * Blue = (0,0,255) Black = (0, 0, 0) Green = (0,255,0) White = (255,255,255) pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption('Sailing!') FPS = 30 fpsClock = pygame.time.Clock() Sail = pygame.Surface([100,10]) Sail.set_colorkey (Black) Sail.fill(White) degrees = 0 while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() rotatedSail = pygame.transform.rotate(Sail, degrees) Sail_rect = Sail.get_rect(topleft =(200,150)) DISPLAYSURF.fill(Blue) DISPLAYSURF.blit(rotatedSail, Sail_rect) pygame.display.flip() fpsClock.tick(FPS) degrees += 1