Created
February 23, 2023 16:27
-
-
Save DavidBuchanan314/89a723f6a7370053209022f2d12cae36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
WHITE = (0xff, 0xff, 0xff) | |
pygame.init() | |
screen = pygame.display.set_mode((128, 128)) | |
clock = pygame.time.Clock() | |
arrow_surface = pygame.surface.Surface((64, 64)) | |
pygame.draw.aaline(arrow_surface, WHITE, (32, 0), (32, 64)) | |
pygame.draw.aaline(arrow_surface, WHITE, (32 - 16, 64 - 16), (32, 64)) | |
pygame.draw.aaline(arrow_surface, WHITE, (32 + 16, 64 - 16), (32, 64)) | |
angle = 0 | |
while True: | |
screen.fill((0, 0, 0)) | |
#rotated = pygame.transform.rotozoom(arrow_surface, angle, 1.0) | |
rotated = pygame.transform.rotate(arrow_surface, angle) | |
screen.blit(rotated, (64 - rotated.get_width() / 2, 64 - rotated.get_height() / 2)) | |
pygame.display.flip() | |
clock.tick(60) | |
angle += 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment