gd_cave_clear_sounds(cave);
+ game_bd.player_moving = FALSE;
+ game_bd.player_snapping = FALSE;
+
// if diagonal movements not allowed,
// horizontal movements have precedence. [BROADRIBB]
if (!cave->diagonal_movements)
// if snapping anything and we have snapping explosions set.
// but these is not true for pushing.
if (remains == O_SPACE && player_fire && !push)
+ {
remains = cave->snap_element;
+ game_bd.player_snapping = TRUE;
+ }
+
if (remains != O_SPACE || player_fire)
+ {
// if any other element than space, player cannot move.
// also if pressing fire, will not move.
store_dir(cave, x, y, player_move, remains);
+ }
else
+ {
// if space remains there, the player moves.
move(cave, x, y, player_move, O_PLAYER);
+
+ game_bd.player_moving = TRUE;
+ }
}
}
break;
return game;
}
+boolean check_iteration_reached(GdGame *game)
+{
+ int millisecs_elapsed = 20;
+
+ return (game->milliseconds_game + millisecs_elapsed >= game->cave->speed);
+}
+
static void iterate_cave(GdGame *game, GdDirection player_move, boolean fire)
{
boolean suicide = FALSE;
GdGame *gd_game_new_snapshot(GdCave *snapshot);
GdGame *gd_game_new_test(GdCave *cave, int level);
+boolean check_iteration_reached(GdGame *game);
+
void play_game_func(GdGame *game, int action);
#endif // BD_GAMEPLAY_H
boolean game_over;
boolean cover_screen;
+ boolean player_moving;
+ boolean player_snapping;
+
// needed for updating panel
int time_left;
int gems_still_needed;
// ----------------------------------------------------------------------------
void InitGraphicInfo_BD(void);
+boolean CheckSingleStepMode_BD(boolean, boolean, boolean);
void PlayLevelSound_BD(int, int, int, int);
void StopSound_BD(int, int);
game_bd.game->itermax = 8; // default; dynamically changed at runtime
game_bd.game->itermax_last = game_bd.game->itermax;
+ game_bd.player_moving = FALSE;
+ game_bd.player_snapping = FALSE;
+
// default: start with completely covered playfield
int next_state = GAME_INT_START_UNCOVER + 1;
play_game_func(game_bd.game, action[0]);
}
+ boolean single_step_mode_paused =
+ CheckSingleStepMode_BD(check_iteration_reached(game_bd.game),
+ game_bd.player_moving,
+ game_bd.player_snapping);
+
+ // draw final movement animation frame before going to single step pause mode
+ if (single_step_mode_paused)
+ game_bd.game->itercycle = game_bd.game->itermax - 1;
+
RedrawPlayfield_BD(FALSE);
UpdateGameDoorValues_BD();
}
}
+static void CheckSaveEngineSnapshot_BD(boolean frame_max,
+ boolean player_moving,
+ boolean player_snapping)
+{
+ if (frame_max)
+ {
+ if (!local_player->was_waiting)
+ {
+ if (!CheckSaveEngineSnapshotToList())
+ return;
+
+ local_player->was_waiting = TRUE;
+ }
+ }
+ else if (player_moving || player_snapping)
+ {
+ local_player->was_waiting = FALSE;
+ }
+}
+
static void CheckSaveEngineSnapshot_EM(int frame,
boolean any_player_moving,
boolean any_player_snapping,
}
}
+boolean CheckSingleStepMode_BD(boolean frame_max,
+ boolean player_moving,
+ boolean player_snapping)
+{
+ if (tape.single_step && tape.recording && !tape.pausing)
+ if (frame_max && FrameCounter > 6)
+ TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
+
+ CheckSaveEngineSnapshot_BD(frame_max, player_moving, player_snapping);
+
+ return tape.pausing;
+}
+
boolean CheckSingleStepMode_EM(int frame,
boolean any_player_moving,
boolean any_player_snapping,