用Pygame绘制圆程序

来源:互联网 发布:淘宝被知识产权投诉 编辑:程序博客网 时间:2024/04/29 11:09
#Drawing Circles project
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600,500))
pygame.display.set_caption("Drawing Circles")
while True:
    for event in pygame.event.get():
        if event.type in (QUIT,KEYDOWN):
            pygame.quit()
    screen.fill((0,0,200))
    #draw a circle
    color = 255,255,0
    position = 300,250
    radius = 100
    width = 10
    pygame.draw.circle(screen,color,position,radius,width)
    pygame.display.update()        

0 0