5
私はpygameが初めてで、画像を10秒ごとに90度だけ回転させるコードを書きたいと思っています。私のコードは次のようになります。画像が回転していない、つまり「回転」が、端末ごとに10秒で印刷されているが、このコードは、動作していないpygameを使用して画像を回転
import pygame
import time
from pygame.locals import *
pygame.init()
display_surf = pygame.display.set_mode((1200, 1200))
image_surf = pygame.image.load("/home/tempuser/Pictures/desktop.png").convert()
imagerect = image_surf.get_rect()
display_surf.blit(image_surf,(640, 480))
pygame.display.flip()
start = time.time()
new = time.time()
while True:
end = time.time()
if end - start > 30:
break
elif end - new > 10:
print "rotating"
new = time.time()
pygame.transform.rotate(image_surf,90)
pygame.display.flip()
。誰かが私が間違っていることを教えてもらえますか?