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
float vy = player->get_physic().get_velocity_y();
//player is falling down on trampoline
if(hit.top && vy >= 0) {
- if(player->get_controller()->hold(Controller::JUMP)) {
- vy = VY_MIN;
- } else {
- vy = VY_INITIAL;
- }
+ if (!(player->get_status()->bonus == AIR_BONUS))
+ vy = player->get_controller()->hold(Controller::JUMP) ? VY_MIN : VY_INITIAL;
+ else
+ vy = player->get_controller()->hold(Controller::JUMP) ? VY_MIN - 300 : VY_INITIAL - 40;
player->get_physic().set_velocity_y(vy);
SoundManager::current()->play(TRAMPOLINE_SOUND);
sprite->set_action("swinging", 1);