python-pygame explained in detail

import pygame

pygame.init()

screen=pygame.display.set_mode([500,500])

running=True
while running:
for event in pygame.event.get():
if event.type==pygame.QUIT:
running=False
screen.fill((255,255,255))#设置背景


#参数1 屏幕主体 参数二 圆圈的范围长和宽 参数三圈的半径
pygame.draw.circle(screen,(0,0,255),(250,250),75)

pygame.display.flip() # 显示出所有元素










pygame.quit()

Guess you like

Origin blog.csdn.net/qq_35622606/article/details/131194794