美文网首页
Day16--课后作业

Day16--课后作业

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

    pygame画线: 正在研究....

    import pygame
    
    pygame.init()
    screen = pygame.display.set_mode((600, 400))
    screen.fill((196, 183, 179))
    pygame.display.flip()
    start=(0,0)
    col=[]
    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                exit()
            elif event.type == pygame.MOUSEBUTTONDOWN:
                 col.append(pygame.mouse.get_pos())
                 if len(col)>=2:
                     pygame.draw.line(screen, (0, 0, 0), col[0], col[1], 5)
                     pygame.display.flip()
                     col.pop(0)
    

    相关文章

      网友评论

          本文标题:Day16--课后作业

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