import pygame
SIZE = 1000, 900
pygame.init()
screen = pygame.display.set_mode(SIZE)
a=0
done = False
screen.fill((0, 0, 0))
other1 = pygame.image.load("image.jpg")
screen.blit(other1, (0, 0))
while not done:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
a=a+90
other2 = pygame.transform.rotate(other1, a)
screen.blit(other2, (0, 0))
if event.key == pygame.K_RIGHT:
a=a-90
other2 = pygame.transform.rotate(other1, a)
screen.blit(other2, (0, 0))
screen.fill((0,0,0))
pygame.display.flip()
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
One liners using numpy:
Clockwise
Counter-clockwise