public static void hud_update(int pulse) { int clock = game_client.curr_clock(); int coins = game_client.curr_coins(); int goal = Progress.curr_goal(); int balls = Progress.curr_balls(); int score = Progress.curr_score(); int c_id; int last; if (pulse == 0) { /* reset the hud */ gui.gui_pulse(ball_id, 0); gui.gui_pulse(time_id, 0); gui.gui_pulse(coin_id, 0); } /* time and tick-tock */ if (clock != (last = gui.gui_value(time_id))) { gui.gui_set_clock(time_id, clock); if (last > clock && pulse != 0) { if (clock <= 1000 && (last / 100) > (clock / 100)) { Audio.audio_play(Common.AUD_TICK, 1); gui.gui_pulse(time_id, 1.50f); } else if (clock < 500 && (last / 50) > (clock / 50)) { Audio.audio_play(Common.AUD_TOCK, 1); gui.gui_pulse(time_id, 1.25f); } } } /* balls and score + select coin widget */ switch (Progress.curr_mode()) { case MODE.MODE_CHALLENGE: if (gui.gui_value(ball_id) != balls) { gui.gui_set_count(ball_id, balls); } if (gui.gui_value(scor_id) != score) { gui.gui_set_count(scor_id, score); } c_id = coin_id; break; default: c_id = coin_id; break; } /* coins and pulse */ if (coins != (last = gui.gui_value(c_id))) { last = coins - last; gui.gui_set_count(c_id, coins); if (pulse != 0 && last > 0) { if (last >= 10) { gui.gui_pulse(coin_id, 2.00f); } else if (last >= 5) { gui.gui_pulse(coin_id, 1.50f); } else { gui.gui_pulse(coin_id, 1.25f); } if (goal > 0) { if (last >= 10) { gui.gui_pulse(goal_id, 2.00f); } else if (last >= 5) { gui.gui_pulse(goal_id, 1.50f); } else { gui.gui_pulse(goal_id, 1.25f); } } } } /* goal and pulse */ if (goal != (last = gui.gui_value(goal_id))) { gui.gui_set_count(goal_id, goal); if (pulse != 0 && goal == 0 && last > 0) { gui.gui_pulse(goal_id, 2.00f); } } }