File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,29 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit)
85
85
auto player = dynamic_cast <Player*> (&other);
86
86
// Trampoline works for player
87
87
if (player) {
88
+ if (player->m_does_buttjump )
89
+ player->m_does_buttjump = false ;
88
90
float vy = player->get_physic ().get_velocity_y ();
89
91
// player is falling down on trampoline
90
92
if (hit.top && vy >= 0 ) {
91
93
if (!(player->get_status ().bonus == AIR_BONUS))
92
- vy = player->get_controller ().hold (Control::JUMP) ? 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
+ }
93
102
else
94
- vy = player->get_controller ().hold (Control::JUMP) ? 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
+ }
95
111
player->get_physic ().set_velocity_y (vy);
96
112
SoundManager::current ()->play (TRAMPOLINE_SOUND, get_pos ());
97
113
m_sprite->set_action (" swinging" , 1 );
You can’t perform that action at this time.
0 commit comments