美文网首页
python hw 小娃娃制作

python hw 小娃娃制作

作者: Sakura_flower | 来源:发表于2018-10-22 22:17 被阅读0次

头像小娃娃

import pygame
pygame.init()
screen = pygame.display.set_mode((800, 500))
screen.fill((255, 255, 255))
pygame.draw.circle(screen, (255, 0, 0), (400, 200), 100, 0)
pygame.draw.line(screen, (255, 255, 0), (400,200), (380,230), 1)
pygame.draw.line(screen, (255, 255, 0), (380,230), (420,230), 1)
pygame.draw.line(screen, (255, 255, 0), (420,230), (400,200), 1)
pygame.draw.circle(screen, (0, 0, 0), (370, 150), 10, 9 )
pygame.draw.circle(screen, (0, 0, 0), (430, 150), 10, 9 )
pygame.draw.line(screen,(0, 255, 0), (380, 250), (420, 250), 4)
pygame.draw.line(screen, (255, 0, 0), (340, 280), (340, 380), 2)
pygame.draw.line(screen, (255, 0, 0), (460, 280), (460, 380), 2)
pygame.draw.line(screen, (255, 0, 0), (340, 380), (460, 380), 2)
pygame.draw.line(screen, (255, 0, 0), (340, 280), (300, 350), 2)
pygame.draw.line(screen, (255, 0, 0), (460, 280), (500, 350), 2)
pygame.draw.circle(screen, (0, 0, 0), (300, 350), 15, 0)
pygame.draw.circle(screen, (0, 0, 0), (500, 350), 15, 0)
pygame.display.flip()
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            exit()

相关文章

网友评论

      本文标题:python hw 小娃娃制作

      本文链接:https://www.haomeiwen.com/subject/atmnzftx.html