File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ const float SWIM_ACCEL = 600.f;
144
144
const float SWIM_BOOST_ACCEL = 2400 .f;
145
145
const float TURN_MAGNITUDE = 0 .15f ;
146
146
const float TURN_MAGNITUDE_BOOST = 0 .2f ;
147
+ const float SWIM_JUMP_SPEED = 450 .f;
148
+ const float SWIM_BOOST_JUMP_SPEED = 600 .f;
147
149
148
150
/* Buttjump variables */
149
151
@@ -458,8 +460,12 @@ Player::update(float dt_sec)
458
460
if (m_swimming)
459
461
{
460
462
m_water_jump = true ;
461
- if (m_physic.get_velocity_y () > -350 .f && m_controller->hold (Control::UP))
462
- m_physic.set_velocity_y (-350 .f );
463
+ if (m_controller->hold (Control::UP)) {
464
+ if (m_physic.get_velocity_y () > -SWIM_JUMP_SPEED && !m_swimboosting)
465
+ m_physic.set_velocity_y (-SWIM_JUMP_SPEED);
466
+ else if (m_physic.get_velocity_y () > -SWIM_BOOST_JUMP_SPEED && m_swimboosting) // Bigger jump if boosting
467
+ m_physic.set_velocity_y (-SWIM_BOOST_JUMP_SPEED);
468
+ }
463
469
}
464
470
m_swimming = false ;
465
471
}
You can’t perform that action at this time.
0 commit comments