import pygame
from pygame.locals import *
from sys import exit
from math import pi, sin, cos
pygame.init()
BLACK = (0,0,0)
WHITE = (255,255,255)
RED = (255,0,0)
size = width,height = 400,400
screen = pygame.display.set_mode(size)
position = width//2, height//2
s = sin(pi//3)*200
c = cos(pi//3)*200
points1 = [(200,0), (200-s, 200+c), (200+s, 200+c)]
points2 = [(200-s, 200-c), (200, 400), (200+s, 200-c)]
clock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.fill(BLACK)
pygame.draw.circle(screen, RED, position, 200, 0)
pygame.draw.lines(screen, BLACK, True, points1,2)
pygame.draw.lines(screen, BLACK, True, points2,2)
pygame.draw.circle(screen, BLACK, position, 20)
pygame.display.flip()
clock.tick(10)
СºÚÎÝ|ÊÖ»ú°æ|Archiver|ÓãC¹¤×÷ÊÒ ( ÔÁICP±¸18085999ºÅ-1 | ÔÁ¹«Íø°²±¸ 44051102000585ºÅ)
GMT+8, 2024-5-1 14:34
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.