Bouncing on enemies and trampolines also gets a hight bonus from airflower
[supertux.git] / src / object / player.cpp
index c40a9ee..3af291c 100644 (file)
@@ -1511,10 +1511,12 @@ Player::get_velocity()
 void
 Player::bounce(BadGuy& )
 {
-  if(controller->hold(Controller::JUMP))
-    physic.set_velocity_y(-520);
-  else
-    physic.set_velocity_y(-300);
+  if(!(player_status->bonus == AIR_BONUS))
+    physic.set_velocity_y(controller->hold(Controller::JUMP) ? -520 : -300);
+  else {
+    physic.set_velocity_y(controller->hold(Controller::JUMP) ? -580 : -340);
+    glide_time = player_status->max_air_time * GLIDE_TIME_PER_FLOWER;
+  }
 }
 
 //scripting Functions Below