static int coins_id;
static int score_id;
+/* Bread crumbs. */
+
static int new_name;
static int be_back_soon;
/* Fall through. */
case GOAL_OVER:
- if (curr_lg()->mode == MODE_CHALLENGE)
- return goto_state(&st_over);
- else
- return goto_state(&st_start);
+ level_stop();
+ return goto_state(&st_over);
case GOAL_SAVE:
be_back_soon = 1;
+
+ level_stop();
return goto_save(&st_goal, &st_goal);
case GOAL_NAME:
new_name = 1;
be_back_soon = 1;
+
+ level_stop();
return goto_name(&st_goal, &st_goal);
case GOAL_DONE:
+ level_stop();
return goto_state(&st_done);
case GOAL_NEXT:
level_next();
- level_play(curr_lg()->level, curr_lg()->mode);
return goto_state(&st_level);
case GOAL_SAME:
- level_play(curr_lg()->level, curr_lg()->mode);
+ level_same();
return goto_state(&st_level);
}
static int goal_enter(void)
{
+ const char *s1 = _("New Record");
+ const char *s2 = _("GOAL");
+
int id, jd, kd;
const struct level_game *lg = curr_lg();
int gid;
if (high)
- gid = gui_label(id, _("New Record"), GUI_MED, GUI_ALL, gui_grn, gui_grn);
+ gid = gui_label(id, s1, GUI_MED, GUI_ALL, gui_grn, gui_grn);
else
- gid = gui_label(id, _("GOAL"), GUI_LRG, GUI_ALL, gui_blu, gui_grn);
+ gid = gui_label(id, s2, GUI_LRG, GUI_ALL, gui_blu, gui_grn);
gui_space(id);
lg->mode != MODE_CHALLENGE);
}
- gui_maybe(jd, _("Save Replay"), GOAL_SAVE, demo_play_saved());
+ gui_maybe(jd, _("Save Replay"), GOAL_SAVE, demo_saved());
/* Default is next if the next level is newly unlocked. */
if (time_state() < 1.f)
{
game_step(g, dt, 0);
- /* demo_play_step(dt); */
+ demo_play_step(dt);
}
else if (DT > 0.05f && coins_id)
{
return 1;
}
-
-void goal_leave(int id)
+static void goal_leave(int id)
{
/* HACK: don't run animation if only "visiting" a state. */
st_goal.timer = be_back_soon ? shared_timer : goal_timer;
gui_delete(id);
}
-
/*---------------------------------------------------------------------------*/
struct state st_goal = {