酷炫唐小鸭

酷炫唐小鸭.gif
""" by_sawyer """
"""
酷炫唐小鸭
"""
import pygame
if __name__ == '__main__':
    pygame.init()
    screen = pygame.display.set_mode((1000,800))
    screen.fill((0,0,0))
    while True:
        from math import pi                                                                 # 声明pi
        import random                                                                       # 声明随机数模块
        def color():                                                                        # 封装color函数
            return random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)
        # 头部
        pygame.draw.arc(screen, color(), (300, 100, 230, 180), -pi * 3 / 7, pi*11/10,3)     # 头,整体
        pygame.draw.arc(screen, color(), (370, 140, 30, 30), pi*1/6, pi * 5 / 6,3 )         # 眉毛
        pygame.draw.arc(screen, color(), (370, 180, 30, 40), 0 ,pi * 2,3)                   # 外眼圈
        pygame.draw.arc(screen, color(), (370, 190, 15, 22), 0, pi * 2,3)                   # 内眼圈
        pygame.draw.arc(screen, color(), (158, 138, 160, 100), - pi*5/12,- pi*1/6,3)        # 下嘴壳
        pygame.draw.arc(screen, color(), (250, 220, 200, 60), -pi*8/7,- pi/2,3 )            # 上嘴壳
        pygame.draw.arc(screen, color(), (271, 215, 60, 40),  0 ,pi/2,3 )                   # 上鼻梁线
        pygame.draw.arc(screen, color(), (331, 193, 20, 87), -pi, - pi/2,3)                 # 下鼻梁线
        pygame.draw.arc(screen, color(), (280, 193, 50, 60), -pi*6/10, - pi / 2,3)          # 鼻孔
        # 身体
        pygame.draw.arc(screen, color(), (370, 320, 260, 140), pi*42/52, pi*1/6,3)          # 大身体
        pygame.draw.arc(screen, color(), (470, 316, 120, 90), 0, 2 * pi,3)                  # 翅膀
        pygame.draw.arc(screen, color(), (456, 220, 90, 110), pi, -pi*4/7,3)                # 后颈
        pygame.draw.arc(screen, color(), (288, 280, 120, 86), -pi *2/ 9,pi/2,3 )            # 前颈
        pygame.draw.arc(screen, color(), (562, 346, 52, 20), -pi / 2,0,3)                   # 屁股
        # 水池
        pygame.draw.arc(screen, color(), (325, 400, 90, 50), pi/2, -pi * 6 / 7,3)           # 水花1
        pygame.draw.arc(screen, color(), (300, 412, 400, 80), pi*5/6 ,-pi *3/ 5,3)          # 水花2
        pygame.draw.arc(screen, color(), (475, 400, 200, 120), -pi*24/40,pi*1/3,3)          # 水花3
        pygame.draw.arc(screen, color(), (432, 460, 150, 60), pi , -pi *7 / 23,3)           # 水花4
        pygame.draw.arc(screen, color(), (510, 480, 30, 20), 0, 2*pi,3)                     # 水泡

        font = pygame.font.Font('./font/font/aa.ttf', 50)                                   # 调用字体
        surface = font.render('Deysign by Sawyer', True, color())                           # 字体内容和颜色
        screen.blit(surface, (600, 600))                                                    # 字体位置
        # 将内容展示在屏幕上
        pygame.display.flip()

        for event in pygame.event.get():
            if event.type ==pygame.QUIT:
                exit()

你可能感兴趣的:(酷炫唐小鸭)