我需要在屏幕中心旋转一个三角形(不是图片)。我看到其他人回答了这个问题,但是三角形不能朝上。
我尝试使用其他人的函数,但它们似乎只部分起作用,就像我上面提到的函数。
我尝试使用其他人的函数,但它们似乎只部分起作用,就像我上面提到的函数。
import pygame
disp=pygame.display.set_mode((200,200))
import math
def rotate_triange(mouse_pos,triangle_pos):
#The code here
import time
while True:
time.sleep(1)
pygame.Surface.fill(disp,(255,255,255))
center = (100,100)
radius = 10
mouse_position = pygame.mouse.get_pos()
for event in pygame.event.get():
pass
points = rotate_triangle((100,100),mouse_position)
pygame.draw.polygon(disp,(0,0,0),points)
pygame.display.update()