X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=b5857c902dfa77657f5c9ed69ea1b5ad0c051d1a;hb=8d033f0cbe51f8cf71898a6a4f2e77dcc32e3857;hp=ad6b880a5485b49445f61c6cca3ea5a0d0c7b10d;hpb=b474abf466009731ef0d7bbf4cb98896f213ffb4;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index ad6b880a5..b5857c902 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -413,9 +413,9 @@ GameSession::check_end_conditions() Player* tux = world->get_tux(); /* End of level? */ - int endpos = (World::current()->get_level()->width-10) * 32; + int endpos = (World::current()->get_level()->width-5) * 32; Tile* endtile = collision_goal(tux->base); - //printf("EndTile: %p.\n", endtile); + // fallback in case the other endpositions don't trigger if (tux->base.x >= endpos || (endtile && endtile->data >= 1) || (end_sequence && !endsequence_timer.check())) @@ -614,8 +614,7 @@ GameSession::run() world->play_music(HERRING_MUSIC); } /* are we low on time ? */ - else if (time_left.get_left() < TIME_WARNING - && (world->get_music_type() == LEVEL_MUSIC)) + else if (time_left.get_left() < TIME_WARNING) { world->play_music(HURRYUP_MUSIC); } @@ -666,12 +665,13 @@ GameSession::drawstatus() white_text->draw("Press ESC To Return",0,20,1); } - if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) - { - sprintf(str, "%d", time_left.get_left() / 1000 ); - white_text->draw("TIME", 224, 0, 1); - gold_text->draw(str, 304, 0, 1); - } + if(!time_left.check()) { + white_text->draw("TIME'S UP", 224, 0, 1); + } else if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) { + sprintf(str, "%d", time_left.get_left() / 1000 ); + white_text->draw("TIME", 224, 0, 1); + gold_text->draw(str, 304, 0, 1); + } sprintf(str, "%d", player_status.distros); white_text->draw("COINS", screen->h, 0, 1);