From: Marek Moeckel Date: Wed, 15 Sep 2004 22:39:24 +0000 (+0000) Subject: disabled hovering by default (needs tweaking!) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=86f3475b2716e98bde0742fc4f8adecc9e4bb826;p=supertux.git disabled hovering by default (needs tweaking!) added cheat code "hover" to toggle hovering on/off SVN-Revision: 1924 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index a178f4906..3dbec9027 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -447,6 +447,11 @@ GameSession::process_events() tux.kill(tux.KILL); last_keys.clear(); } + if(compare_last(last_keys, "hover")) + { // toggle hover ability on/off + tux.enable_hover = !tux.enable_hover; + last_keys.clear(); + } break; case SDL_JOYAXISMOTION: diff --git a/src/player.cpp b/src/player.cpp index 114a9699f..af12e7806 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -161,6 +161,7 @@ Player::init() double_jumping = false; can_jump = true; can_double_jump = false; + enable_hover = false; butt_jump = false; frame_main = 0; @@ -560,7 +561,9 @@ Player::handle_vertical_input() } // Hover - if (input.up == DOWN && !jumping && !butt_jump && physic.get_velocity_y() <= 0) + //(disabled by default, use cheat code "hover" to toggle on/off) + //TODO: needs some tweaking, especially when used together with double jump and jumping off badguys + if (enable_hover && input.up == DOWN && !jumping && !butt_jump && physic.get_velocity_y() <= 0) { physic.set_velocity_y(-1); } diff --git a/src/player.h b/src/player.h index 071d4773c..fc7c09edf 100644 --- a/src/player.h +++ b/src/player.h @@ -150,6 +150,7 @@ public: bool double_jumping; bool can_jump; bool can_double_jump; + bool enable_hover; bool butt_jump; int frame_; int frame_main;