[Super-tux-commit] supertux/src gameloop.cpp,1.179,1.180 player.cpp,1.167,1.168 player.h,1.85,1.86
Brought to you by:
wkendrick
From: Marek M. <wa...@us...> - 2004-09-15 22:39:33
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2315/src Modified Files: gameloop.cpp player.cpp player.h Log Message: disabled hovering by default (needs tweaking!) added cheat code "hover" to toggle hovering on/off Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.167 retrieving revision 1.168 diff -u -d -r1.167 -r1.168 --- player.cpp 15 Sep 2004 15:15:24 -0000 1.167 +++ player.cpp 15 Sep 2004 22:39:23 -0000 1.168 @@ -161,6 +161,7 @@ double_jumping = false; can_jump = true; can_double_jump = false; + enable_hover = false; butt_jump = false; frame_main = 0; @@ -560,7 +561,9 @@ } // 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); } Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- player.h 15 Sep 2004 15:15:25 -0000 1.85 +++ player.h 15 Sep 2004 22:39:24 -0000 1.86 @@ -150,6 +150,7 @@ bool double_jumping; bool can_jump; bool can_double_jump; + bool enable_hover; bool butt_jump; int frame_; int frame_main; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- gameloop.cpp 15 Sep 2004 22:12:00 -0000 1.179 +++ gameloop.cpp 15 Sep 2004 22:39:21 -0000 1.180 @@ -447,6 +447,11 @@ 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: |