From 911457f379b724c629602ac8d0c21ffb23ca1a48 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Thu, 16 Sep 2004 11:56:39 +0000 Subject: [PATCH] Added a "gotoend" cheat to put Tux near the end of the level. Also improved the pause hack. SVN-Revision: 1926 --- src/gameloop.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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: -- 2.11.0