diff --git a/SQCSim2021/player.cpp b/SQCSim2021/player.cpp index 13c2174..e7e3152 100644 --- a/SQCSim2021/player.cpp +++ b/SQCSim2021/player.cpp @@ -25,7 +25,7 @@ void Player::Move(bool front, bool back, bool left, bool right, bool jump, bool static int dashtimeout = 0; static float gametime = 0; - if (gametime <= 360.f) gametime += elapsedTime*m_topspeed/2; else gametime = 0; + if (gametime <= 360.f) gametime += elapsedTime * m_topspeed / 2; else gametime = 0; if (dashtimeout > 0) { dash = false; @@ -75,7 +75,8 @@ void Player::Move(bool front, bool back, bool left, bool right, bool jump, bool if (dash) accWS = m_topspeed; // Pour avoir un boost de vitesse vers l'avant si le dash est appuyé seul. } - m_position.y += accjmp + (sin(gametime) - 0.5f) * ((abs(accWS) + abs(accAD)) / 2.f) / (10.f * m_topspeed);; + // Ajoute l'accélération de saut et le view bobbing. + m_position.y += accjmp + (sin(gametime) - 0.5f) * ((abs(accWS) + abs(accAD)) / 2.f) / (10.f * m_topspeed); if (front) { if (dbljump == 0)