Skip to content

Commit 08b020d

Browse files
committed
Jump higher on trampoline when groundpounding
1 parent afb12af commit 08b020d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/object/trampoline.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
8585
auto player = dynamic_cast<Player*> (&other);
8686
//Trampoline works for player
8787
if (player) {
88+
if (player->m_does_buttjump)
89+
player->m_does_buttjump = false;
8890
float vy = player->get_physic().get_velocity_y();
8991
//player is falling down on trampoline
9092
if (hit.top && vy >= 0) {
9193
if (!(player->get_status().bonus == AIR_BONUS))
92-
vy = player->get_controller().hold(Control::JUMP) ? VY_MIN : VY_INITIAL;
94+
vy = (player->get_controller().hold(Control::JUMP) || player->get_controller().hold(Control::DOWN)) ? VY_MIN : VY_INITIAL;
9395
else
94-
vy = player->get_controller().hold(Control::JUMP) ? VY_MIN - 300 : VY_INITIAL - 40;
96+
vy = (player->get_controller().hold(Control::JUMP) || player->get_controller().hold(Control::DOWN)) ? VY_MIN - 300 : VY_INITIAL - 40;
9597
player->get_physic().set_velocity_y(vy);
9698
SoundManager::current()->play(TRAMPOLINE_SOUND);
9799
m_sprite->set_action("swinging", 1);

0 commit comments

Comments
 (0)