简笔小人-抽象到底

import pygame

if __name__ == "__main__":
    pygame.init()
    # 创建一个屏幕
    screen = pygame.display.set_mode((1000, 1000))
    # 将背景填充为白色
    screen.fill((255, 255, 255))
    # 绘制圆形头部
    pygame.draw.circle(screen, (0, 0, 0), (500, 50), 50, 3)
    # 左眼
    pygame.draw.circle(screen, (0, 0, 0), (480, 25), 5, 3)
    # 右眼
    pygame.draw.circle(screen, (0, 0, 0), (520, 25), 5, 3)
    # 鼻子
    pygame.draw.circle(screen, (0, 0, 0), (500, 50), 5, 0)
    # 嘴巴
    pygame.draw.line(screen, (0, 0, 0), (495, 75), (505, 75), 3)
    # 左躯
    pygame.draw.line(screen, (0, 0, 0), (400, 150), (500, 300), 3)
    # 右躯
    pygame.draw.line(screen, (0, 0, 0), (600, 150), (500, 300), 3)

    pygame.draw.line(screen, (0, 0, 0), (400, 300), (600, 300), 3)

    pygame.draw.line(screen, (0, 0, 0), (400, 300), (350, 700), 3)

    pygame.draw.line(screen, (0, 0, 0), (600, 300), (650, 700), 3)

    # 绘制肩膀
    pygame.draw.line(screen, (0, 0, 0), (400, 150), (600, 150), 3)
    # 绘制左臂
    pygame.draw.line(screen, (0, 0, 0), (400, 150), (350, 350), 3)
    # 绘制右臂
    pygame.draw.line(screen, (0, 0, 0), (600, 150), (650, 350), 3)
    # 绘制脊柱
    pygame.draw.line(screen, (0, 0, 0), (500, 100), (500, 300), 3)
    # 绘制左腿
    pygame.draw.line(screen, (0, 0, 0), (500, 300), (350, 700), 3)
    # 绘制右腿
    pygame.draw.line(screen, (0, 0, 0), (500, 300), (650, 700), 3)
    pygame.display.flip()
    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                print('关闭按钮被点击')
                exit()
image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 今天八点钟丁总就带团队到龙健身售卡现场,经过现场老师再次简单培训就开始了一上午的工作了。锦龙四个店的管理层全部在现...
    侍艳阅读 289评论 0 0
  • 我们两个呆在一起的时候,总会给彼此留一些时间和空间。心照不宣的,我们各忙各的事儿,相互倚靠着并没有过多的交流,却也...
    夏筱白阅读 532评论 13 12