Ejemplo n.º 1
0
def new_game():
    global player, alive, state, current_turn
    starting_items = ui.item_choice_menu()
    if starting_items is None:
        # player closed window during starting item dialog
        return
    terrain.map = mapgen.generate_map()

    pos = terrain.map.player_start_pos
    player = mob.Player(pos)
    for i in starting_items:
        player.get(i((0, 0)))

    # terrain.map.init_fov_and_pathfinding()

    for i in range(50):
        update_objects()

    terrain.map.objects.append(player)
    ui.clear_messages()

    render.init()
    compute_fov()
    render.draw_all_tiles()

    alive = True
    state = 'playing'

    current_turn = 1

    ui.message(
        'Good job! You managed to sneak into the fortress of the dwarves and nabbed a priceless artifact while the dwarves were busy repelling a seige. Unfortunately, your escape route is now encased in battle! Can you navigate 200 tiles of mayhem?')
Ejemplo n.º 2
0
def new_game():
    global player, alive, state, current_turn
    starting_items = ui.item_choice_menu()
    if starting_items is None:
        #player closed window during starting item dialog
        return
    terrain.map = mapgen.generate_map()

    (x, y) = terrain.map.player_start_pos
    terrain.map[x][y] = terrain.Floor()
    player = mob.Player((x, y))
    for i in starting_items:
        player.get(i((0, 0)))

    terrain.map.init_fov_and_pathfinding()

    for i in range(50):
        randomly_spawn_enemies()
        update_objects()

    terrain.map.mobs.append(player)
    ui.clear_messages()

    render.init()
    compute_fov()
    render.draw_all_tiles()

    alive = True
    state = 'playing'

    current_turn = 1

    ui.message('For this mission something something you need to get to the other side of this battlefield! Go 100 tiles to the right!')