- // Check End conditions
- if (tux->is_dead())
- {
- player_status.lives -= 1;
-
- if (player_status.lives < 0)
- { // No more lives!?
- if(st_gl_mode != ST_GL_TEST)
- drawendscreen();
-
- exit_status = GAME_OVER;
- }
- else
- { // Still has lives, so reset Tux to the levelstart
- restart_level();
- }
+ end_sequence = ENDSEQUENCE_WAITING;
+ }
+ else if(!end_sequence && endtile && endtile->data == 0)
+ {
+ end_sequence = ENDSEQUENCE_RUNNING;
+ last_x_pos = -1;
+ music_manager->play_music(level_end_song, 0);
+ endsequence_timer.start(7000); // 5 seconds until we finish the map
+ }
+ else if (!end_sequence && tux->is_dead())
+ {
+ player_status.bonus = PlayerStatus::NO_BONUS;
+ player_status.lives -= 1;
+
+ if (player_status.lives < 0)
+ { // No more lives!?
+ if(st_gl_mode != ST_GL_TEST)
+ drawendscreen();
+
+ exit_status = GAME_OVER;
+ }
+ else
+ { // Still has lives, so reset Tux to the levelstart
+ restart_level();