示例#1
0
static void over_timer(int id, float dt)
{
    if (curr_mode() != MODE_CHALLENGE || time_state() > 3.f)
        goto_state(&st_start);

    gui_timer(id, dt);
}
示例#2
0
static void over_timer(int id, float dt)
{
    if (time_state() > 3.f)
        goto_state(&st_exit);

    gui_timer(id, dt);
}
示例#3
0
static void demo_play_timer(int id, float dt)
{
    game_step_fade(dt);
    gui_timer(id, dt);
    hud_timer(dt);

    /*
     * Introduce a one-second pause at the start of replay playback.  (One
     * second is the time during which the "Replay" label is being displayed.)
     * HACK ALERT!  "id == 0" means we got here from the pause screen, so no
     * label has been created and there's no need to wait.
     */

    if (id != 0 && time_state() < 1.0f)
        return;

    /* Spin or skip depending on how fast the demo wants to run. */

    if (!demo_replay_step(dt))
    {
        demo_paused = 0;
        goto_state(&st_demo_end);
    }
    else
        progress_step();
}
示例#4
0
static void demo_timer(int id, float dt)
{
    if (total == 0 && time_state() > 4.0f)
        goto_state(&st_title);

    gui_timer(id, dt);
}
示例#5
0
static void title_timer(int id, float dt)
{
    float g[3] = { 0.f, 0.f, 0.f };

    game_step(g, dt);
    game_set_fly(fcosf(time_state() / 10.f));

    gui_timer(id, dt);
}
示例#6
0
static void fall_timer(int id, float dt)
{
    if (time_state() > 3)
    {
        if (hole_next())
            goto_state(&st_next);
        else
            goto_state(&st_score);
    }
}
示例#7
0
static void play_loop_paint(int id, float t)
{
    game_client_draw(0, t);

    if (show_hud)
        hud_paint();

    if (time_state() < 1.f)
        gui_paint(id);
}
示例#8
0
static void demo_play_paint(int id, float t)
{
    game_client_draw(0, t);

    if (show_hud)
        hud_paint();

    if (time_state() < prelude)
        gui_paint(id);
}
示例#9
0
static void demo_play_paint(int id, float t)
{
    game_draw(0, t);

    if (show_hud)
        hud_paint();

    if (time_state() < 1.f)
        gui_paint(id);
}
示例#10
0
static void fall_out_timer(int id, float dt)
{
    if (time_state() < 2.f)
    {
        game_server_step(dt);
        game_client_step(demo_file());
    }

    gui_timer(id, dt);
}
示例#11
0
static void flyby_timer(int id, float dt)
{
    float t = time_state();

    if (dt > 0.f && t > 1.f)
        goto_state(&st_stroke);
    else
        game_set_fly(1.f - t);

    gui_timer(id, dt);
}
示例#12
0
static void play_set_timer(int id, float dt)
{
    float t = time_state();

    game_client_fly(0.5f - 0.5f * t);

    if (dt > 0.0f && t > 1.0f)
        goto_state(&st_play_loop);

    game_step_fade(dt);
    hud_cam_timer(dt);
    gui_timer(id, dt);
}
示例#13
0
static void stop_timer(int id, float dt)
{
    float g[3] = { 0.f, 0.f, 0.f };

    game_update_view(dt);
    game_step(g, dt);

    if (time_state() > 1)
    {
        if (hole_next())
            goto_state(&st_next);
        else
            goto_state(&st_score);
    }
}
示例#14
0
static void goal_timer(int id, float dt)
{
    if (!resume)
    {
        static float t = 0.0f;

        t += dt;

        if (time_state() < 1.f)
        {
            game_server_step(dt);
            game_client_sync(demo_fp);
            game_client_blend(game_server_blend());
        }
        else if (t > 0.05f && coins_id)
        {
            int coins = gui_value(coins_id);

            if (coins > 0)
            {
                int score = gui_value(score_id);
                int balls = gui_value(balls_id);

                gui_set_count(coins_id, coins - 1);
                gui_pulse(coins_id, 1.1f);

                gui_set_count(score_id, score + 1);
                gui_pulse(score_id, 1.1f);

                if (progress_reward_ball(score + 1))
                {
                    gui_set_count(balls_id, balls + 1);
                    gui_pulse(balls_id, 2.0f);
                    audio_play(AUD_BALL, 1.0f);
                }
            }
            t = 0.0f;
        }
    }

    gui_timer(id, dt);
}
示例#15
0
static void demo_play_timer(int id, float dt)
{
    game_step_fade(dt);
    gui_timer(id, dt);
    hud_timer(dt);

    /* Pause briefly before starting playback. */

    if (time_state() < prelude)
        return;

    if (!demo_replay_step(dt))
    {
        demo_paused = 0;
        goto_state(&st_demo_end);
    }
    else
    {
        progress_step();
        game_client_blend(demo_replay_blend());
    }
}