[Super-tux-commit] supertux/src player.h,1.90,1.91 gameloop.cpp,1.191,1.192 player.cpp,1.191,1.192
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-10-30 11:45:56
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14406/src Modified Files: player.h gameloop.cpp player.cpp Log Message: Added my own flapping. :) Made flapping to be configurable, just to get some feedback from players. To try the different ones, type: 'marek', 'ricardo' and 'ryan' during game. Marek is default. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.191 retrieving revision 1.192 diff -u -d -r1.191 -r1.192 --- player.cpp 30 Oct 2004 11:23:34 -0000 1.191 +++ player.cpp 30 Oct 2004 11:45:44 -0000 1.192 @@ -169,7 +169,13 @@ butt_jump = false; flapping_velocity = 0; - + + // temporary to help player's choosing a flapping + int flapping_mode = MAREK_FLAP; + + // Ricardo's flapping + flaps_nb = 0; + frame_main = 0; frame_ = 0; @@ -571,6 +577,7 @@ flapping = false; can_jump = false; can_flap = false; + flaps_nb = 0; // Ricardo's flapping if (size == SMALL) SoundManager::get()->play_sound(IDToSound(SND_JUMP)); else @@ -590,7 +597,21 @@ } } - + // temporary to help player's choosing a flapping + if(flapping_mode == RICARDO_FLAP) + { + // Flapping, Ricardo's version + // similar to SM3 Fox + if(input.jump == DOWN && input.old_jump == UP && can_flap && + flaps_nb < 3) + { + physic.set_velocity_y(3.5); + physic.set_velocity_x(physic.get_velocity_x() * 0.35); + flaps_nb++; + } + } + else if(flapping_mode == MAREK_FLAP) + { // Flapping, Marek's version if (input.jump == DOWN && can_flap) { @@ -617,8 +638,10 @@ physic.set_velocity_y((float)flapping_timer.get_gone()/850); } } - - /* // Flapping, Ryan's version + } + else if(flapping_mode == RYAN_FLAP) + { + // Flapping, Ryan's version if (input.jump == DOWN && can_flap) { if (!flapping_timer.started()) @@ -658,7 +681,8 @@ { physic.set_acceleration_y(0); } - */ + } + // Hover //(disabled by default, use cheat code "hover" to toggle on/off) Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- player.h 9 Oct 2004 18:01:02 -0000 1.90 +++ player.h 30 Oct 2004 11:45:44 -0000 1.91 @@ -160,6 +160,13 @@ float flapping_velocity; + // Ricardo's flapping + int flaps_nb; + + // temporary to help player's choosing a flapping + enum { MAREK_FLAP, RICARDO_FLAP, RYAN_FLAP, NONE_FLAP }; + int flapping_mode; + base_type previous_base; Timer invincible_timer; Timer skidding_timer; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.191 retrieving revision 1.192 diff -u -d -r1.191 -r1.192 --- gameloop.cpp 29 Oct 2004 22:49:07 -0000 1.191 +++ gameloop.cpp 30 Oct 2004 11:45:44 -0000 1.192 @@ -477,6 +477,22 @@ currentsector->camera->reset(Vector(tux.base.x, tux.base.y)); last_keys.clear(); } + // temporary to help player's choosing a flapping + if(compare_last(last_keys, "marek")) + { + tux.flapping_mode = Player::MAREK_FLAP; + last_keys.clear(); + } + if(compare_last(last_keys, "ricardo")) + { + tux.flapping_mode = Player::RICARDO_FLAP; + last_keys.clear(); + } + if(compare_last(last_keys, "ryan")) + { + tux.flapping_mode = Player::RYAN_FLAP; + last_keys.clear(); + } break; case SDL_JOYAXISMOTION: |