slither.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:pygame-robotics 作者: ioarun 项目源码 文件源码
def game_intro():

    intro = True

    while intro:

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

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_c:
                    intro = False
                if event.key == pygame.K_q:
                    pygame.quit()
                    quit()

        gameDisplay.fill(white)
        message_to_screen("Welcome to Slither", 
            green,
            -100,
            "large")

        message_to_screen("The objective of the game is to eat red apples.",
            black,
            -30)
        message_to_screen("The more apples you eat, the longer you get.",
            black,
            10)
        message_to_screen("If you run into yourself, or the edges, you die.",
            black,
            50)

        message_to_screen("Press C to play, P to pause or Q to quit.",
            black,
            180)

        pygame.display.update()
        clock.tick(15)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号