game->milliseconds_anim = 0;
game->milliseconds_game = 0; // set game timer to zero, too
+ game->cycle_counter = 0;
+
// create new element buffer
game->element_buffer = gd_cave_map_new(game->cave, int);
}
}
- // store last maximum number of cycles (to force redraw if changed)
+ // store last maximum number of cycle frames (to force redraw if changed)
game->itermax_last = game->itermax;
- // update maximum number of cycles (frame) per cave iteration
- game->itermax = game->itercycle;
+ // store maximum number of cycle frames separately for even and odd cycles
+ game->itermax2[game->cycle_counter % 2] = game->itercycle;
+
+ // update maximum number of cycle frames per cave iteration
+ game->itermax = game->itermax2[!(game->cycle_counter % 2)];
- // reset cycle (frame) counter for the next cave iteration
+ // reset cycle frame counter for the next cave iteration
game->itercycle = 0;
iterate_cave(game, game->player_move, game->player_fire);
+ game->cycle_counter++;
+
if (game->player_move == GD_MV_STILL)
{
game->player_move_stick = FALSE;
game_bd.game->itercycle = 0;
game_bd.game->itermax = 8; // default; dynamically changed at runtime
game_bd.game->itermax_last = game_bd.game->itermax;
+ game_bd.game->itermax2[0] = game_bd.game->itermax;
+ game_bd.game->itermax2[1] = game_bd.game->itermax;
game_bd.player_moving = FALSE;
game_bd.player_snapping = FALSE;