From: Ricardo Cruz Date: Thu, 16 Sep 2004 11:56:39 +0000 (+0000) Subject: Added a "gotoend" cheat to put Tux near the end of the level. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=911457f379b724c629602ac8d0c21ffb23ca1a48;p=supertux.git Added a "gotoend" cheat to put Tux near the end of the level. Also improved the pause hack. SVN-Revision: 1926 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 3dbec9027..849202bcc 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -365,6 +365,11 @@ GameSession::process_events() case SDLK_p: if(!Menu::current()) { + // "lifeup" cheat activates pause cause of the 'p' + // so work around to ignore it + if(compare_last(last_keys, "lifeu")) + break; + if(game_pause) { game_pause = false; @@ -414,18 +419,6 @@ GameSession::process_events() { player_status.lives++; last_keys.clear(); - // "lifeup" activates pause cause of the 'p' - // so work around to ignore it - if(game_pause) - { - game_pause = false; - Ticks::pause_stop(); - } - else - { - game_pause = true; - Ticks::pause_start(); - } } if(compare_last(last_keys, "lifedown")) { @@ -437,21 +430,28 @@ GameSession::process_events() tux.invincible_timer.start(time_left.get_left()); last_keys.clear(); } - if(compare_last(last_keys, "shrink")) + if(compare_last(last_keys, "shrink")) { // remove powerups tux.kill(tux.SHRINK); last_keys.clear(); } - if(compare_last(last_keys, "kill")) + if(compare_last(last_keys, "kill")) { // kill Tux tux.kill(tux.KILL); last_keys.clear(); } - if(compare_last(last_keys, "hover")) + if(compare_last(last_keys, "hover")) { // toggle hover ability on/off tux.enable_hover = !tux.enable_hover; last_keys.clear(); } + if(compare_last(last_keys, "gotoend")) + { // goes to the end of the level + tux.base.x = (currentsector->solids->get_width()*32) - (screen->w*2); + tux.base.y = 0; + currentsector->camera->reset(Vector(tux.base.x, tux.base.y)); + last_keys.clear(); + } break; case SDL_JOYAXISMOTION: