Skip to content

Commit

Permalink
Fix credits -> gameplay transition bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-rodrigues committed Oct 31, 2020
1 parent fb827b6 commit 1826268
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions debug/debug_playfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void dbg_spawn_platform(const Hero *hero) {

void dbg_print_sandbox_instructions() {
static const char * const line_1 = "Start: Pause";
static const char * const line_2 = "Select: Reset game world";
static const char * const line_2 = "Select: Return to menu";

const int16_t base_x = 320;
const int16_t base_y = 10;
Expand All @@ -50,7 +50,7 @@ void dbg_frame_action(GameContext *context) {
// Select: reset game world (fade out and reload)
if (!gl_fading(context) && p1_pad_edge->select && !context->paused) {
ExtraTask *reload_task = level_reload_sequence_task_init(0, true);
reload_task->level_reload_sequence.final_action = GL_ACTION_RESET_WORLD;
reload_task->level_reload_sequence.final_action = GL_ACTION_SHOW_TITLE;
context->current_fade_handle = reload_task->handle;
}
}
4 changes: 3 additions & 1 deletion game_loop/gameplay_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ static void end_state_check(GameContext *context) {
// Level complete?
if (hero->goal_reached) {
context->level++;

bool roll_credits = (context->level == LEVEL_COUNT);
if (roll_credits) {
context->level = 0;
}

const uint8_t fade_delay = 30;
ExtraTask *task = level_reload_sequence_task_init(fade_delay, false);
Expand Down
2 changes: 1 addition & 1 deletion game_loop/title_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ GameLoopAction title_step_frame(GameContext *context) {
}
} break;
case TITLE_STATE_DISPLAYING_MENU: {
const uint16_t prompt_x = 350;
const uint16_t prompt_x = 370;
const uint16_t prompt_y = 320;
const uint16_t line_spacing = 20;
const int16_t cursor_offset_x = -18;
Expand Down

0 comments on commit 1826268

Please sign in to comment.