美文网首页
2018-10-23 Day17作业(水版)

2018-10-23 Day17作业(水版)

作者: EryangZ | 来源:发表于2018-10-23 19:35 被阅读0次
    """__author__ = ErYang"""
    import pygame
    import random
    from math import pi
    
    def rand_color():
        """随机颜色"""
        return random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)
    
    
    pygame.init()
    screen = pygame.display.set_mode((600, 400))
    screen.fill((125, 125, 125))
    pygame.draw.circle(screen, (0, 180, 220), (300, 200), 150, 5)
    p = 150*(2**0.5/2)
    pygame.draw.arc(screen, (20, 20, 20), (300 - p, 200 - p, 175, 200), 4*pi/3, 11*pi/6, 10)
    list_point = [(300, 200), (300 + p, 200 + p), (300 + p, 200 - p), (300, 200), (300 - p, 200 + p), (300 - p, 200 - p), (300, 200)]
    pygame.draw.lines(screen, (255, 125, 125), True, list_point, 5)
    pygame.display.flip()
    
    
    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                exit()
    
    
    
    
    
    
    
    
    if __name__ == '__main__':
        pass
    
    
    

    相关文章

      网友评论

          本文标题:2018-10-23 Day17作业(水版)

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