File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,23 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
91
91
// player is falling down on trampoline
92
92
if (hit.top && vy >= 0 ) {
93
93
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
+ }
95
102
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
+ }
97
111
player->get_physic ().set_velocity_y (vy);
98
112
SoundManager::current ()->play (TRAMPOLINE_SOUND);
99
113
m_sprite->set_action (" swinging" , 1 );
You can’t perform that action at this time.
0 commit comments