play jump sound again when double jumping
[supertux.git] / src / player.cpp
index 114a969..3bc23df 100644 (file)
@@ -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;
@@ -556,11 +557,17 @@ Player::handle_vertical_input()
                        can_double_jump = false;
                        jumping = true;
                        double_jumping = true;
+                       if (size == SMALL)
+            SoundManager::get()->play_sound(IDToSound(SND_JUMP));
+         else
+            SoundManager::get()->play_sound(IDToSound(SND_BIGJUMP));
                        physic.set_velocity_y(5.2);
          }
        
        // 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);
          }