- }
- else if(end_sequence == ENDSEQUENCE_RUNNING && endtile && endtile->data >= 1)
- {
- end_sequence = ENDSEQUENCE_WAITING;
- }
- else if(!end_sequence && endtile && endtile->data == 0)
- {
- end_sequence = ENDSEQUENCE_RUNNING;
- random_timer.start(200); // start 1st firework
- last_x_pos = -1;
- SoundManager::get()->play_music(level_end_song, 0);
- endsequence_timer.start(7000); // 5 seconds until we finish the map
- tux->invincible_timer.start(7000); //FIXME: Implement a winning timer for the end sequence (with special winning animation etc.)
-
- // add left time to stats
- global_stats.set_points(TIME_NEEDED_STAT, time_left.get_gone() / 1000);
- }
- else if (!end_sequence && tux->is_dead())
- {
- player_status.bonus = PlayerStatus::NO_BONUS;
-
- if (player_status.lives < 0)
- { // No more lives!?
- exit_status = ES_GAME_OVER;
- }
- else
- { // Still has lives, so reset Tux to the levelstart
- restart_level();
- }