如何使此程序中的三角形旋转?

时间:2015-06-03 18:38:16

标签: pygame

请非常具体,因为这是我第一次在pygame工作:D

#!/usr/bin/env python   
import pygame

pygame.init()

#colors
BLACK = (0, 0, 0) 
WHITE = (255, 255, 255)
PI = 3.141592653


size = (400, 500)
screen = pygame.display.set_mode(size)

pygame.display.set_caption("Professor Craven's Cool Game")


done = False
clock = pygame.time.Clock()


while not done:

    for event in pygame.event.get(): 
        if event.type == pygame.QUIT:  
            done = True 


    screen.fill(WHITE)   

    pygame.draw.polygon(screen, BLACK, [[100, 100], [0, 200], [200, 200]], 5)


    font = pygame.font.SysFont('Calibri', 25, True, False)

    text = font.render("Text", True, BLACK)

    screen.blit(text, [250, 250])

    pygame.display.flip()

是的,如果我在此代码中有错误,请告诉我。我很乐意学习有关pygame的新内容。

clock.tick(60)

pygame.quit()

1 个答案:

答案 0 :(得分:0)

尝试:pygame.transform.rotate()来轮播pygame.Surface