level->stats.total_badguys = level->get_total_badguys();
level->stats.total_secrets = level->get_total_count<SecretAreaTrigger>();
level->stats.reset();
- if (!fromBeginning)
- level->stats.declare_invalid();
+ if (!fromBeginning) level->stats.declare_invalid();
if (fromBeginning) reset_sector="";
if(reset_sector != "") {
// Update the world state and all objects in the world
if(!game_pause) {
- currentsector->update(elapsed_time * speed_factor);
- play_time += elapsed_time;
- currentsector->update(elapsed_time);
+ // Update the world
+ if (end_sequence == ENDSEQUENCE_RUNNING) {
+ currentsector->update(elapsed_time/2);
+ } else if(end_sequence == NO_ENDSEQUENCE) {
+ play_time += elapsed_time; //TODO: make sure we don't count cutscene time
+ level->stats.time = play_time;
+ currentsector->update(elapsed_time);
+ }
}
// update sounds
if(end_sequence)
return;
- speed_factor = 0.5;
end_sequence = ENDSEQUENCE_RUNNING;
endsequence_timer.start(7.3);
last_x_pos = -1;
void toggle_pause();
- /**
- * Allows adjusting the game speed with a factor. 1.0 means normal speed
- * 0.0 means the game is stopped.
- */
- void adjust_game_speed(float factor);
-
private:
void check_end_conditions();
void process_events();
std::string reset_sector;
Vector reset_pos;
- /// speed factos
- float speed_factor;
-
// the sector and spawnpoint we should spawn after this frame
std::string newsector;
std::string newspawnpoint;