Esempio n. 1
0
File: main.c Progetto: Df458/Growgue
bool update_game()
{
    int in = get_input(get_map_window());
    if(in == INPUT_ACTION && get_last_action() == ACTION_QUIT)
        return false;
    else if(in == INPUT_ACTION && (get_last_action() == ACTION_SCROLL_UP || get_last_action() == ACTION_SCROLL_DOWN)) {
        log_scroll(get_last_action() == ACTION_SCROLL_UP);
        draw_log();
    } else if(!dead) {
        update_player();
        if(get_current_floor() != current_level) {
            set_current_map(world[get_current_floor()], current_level < get_current_floor(), current_level > get_current_floor());
            current_level = get_current_floor();
        }
        update_map(1, world[current_level]);
        if(is_dead()) {
            add_message(COLOR_HP_CRIT, "Oh dear, you've died!");
            add_message(COLOR_DEFAULT, "Press q to return to the main menu");
            dead = true;
        }
        if(game_won())
            dead = true;
        draw_log();
    }
    return true;
}
Esempio n. 2
0
File: Game.cpp Progetto: nuvie/nuvie
void Game::time_changed()
{
    if(!is_new_style())
    {
        if(game->is_orig_style()) // others constantly update
            get_command_bar()->update(); // date & wind
        get_view_manager()->get_party_view()->update(); // sky
    }
    get_map_window()->updateAmbience();
}