Example #1
0
            if e.type == QUIT or (e.type == KEYDOWN and e.key == K_ESCAPE):
                MAIN_LOOP = False
                HOME_LOOP = False
                GAME_LOOP = False
                display.flip()

            if e.type == KEYDOWN and e.key == K_RETURN:
                window.blit(transform.scale(BACKGROUND, SCREEN_SIZE), (0, 0))
                window.blit(transform.scale(WELCOME, SCREEN_SIZE), (0, 0))
                display.flip()

                HOME_LOOP = False
                GAME_LOOP = True
                window.blit(transform.scale(BACKGROUND, SCREEN_SIZE), (0, 0))
                labyrinth = Map(FILE)
                labyrinth.generate()
                labyrinth.display(window)
                display.flip()
                Macgyver = Player(labyrinth)
                display.flip()
                while GAME_LOOP:
                    time.Clock().tick(30)
                    for e in event.get():
                        if e.type == QUIT:
                            MAIN_LOOP = False
                            GAME_LOOP = False
                        if e.type == KEYDOWN:
                            if e.key == K_RIGHT:
                                Macgyver.move('right')
                            if e.key == K_LEFT:
                                Macgyver.move('left')