Commentaires

This commit is contained in:
Marc-Eric Martel 2021-10-08 09:09:04 -04:00
parent fc0dcc2ebd
commit 57e6c5192f

View File

@ -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)