Skip to content

Commit c495249

Browse files
committed
Tone down velocity
1 parent 08b020d commit c495249

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/object/trampoline.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,23 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
9191
//player is falling down on trampoline
9292
if (hit.top && vy >= 0) {
9393
if (!(player->get_status().bonus == AIR_BONUS))
94-
vy = (player->get_controller().hold(Control::JUMP) || player->get_controller().hold(Control::DOWN)) ? VY_MIN : VY_INITIAL;
94+
{
95+
if (player->get_controller().hold(Control::JUMP))
96+
vy = VY_MIN;
97+
else if (player->get_controller().hold(Control::DOWN))
98+
vy = VY_MIN + 100;
99+
else
100+
vy = VY_INITIAL;
101+
}
95102
else
96-
vy = (player->get_controller().hold(Control::JUMP) || player->get_controller().hold(Control::DOWN)) ? VY_MIN - 300 : VY_INITIAL - 40;
103+
{
104+
if (player->get_controller().hold(Control::JUMP))
105+
vy = VY_MIN - 300;
106+
else if (player->get_controller().hold(Control::DOWN))
107+
vy = VY_MIN - 200;
108+
else
109+
vy = VY_INITIAL - 40;
110+
}
97111
player->get_physic().set_velocity_y(vy);
98112
SoundManager::current()->play(TRAMPOLINE_SOUND);
99113
m_sprite->set_action("swinging", 1);

0 commit comments

Comments
 (0)