diff --git a/SQCSim2021/player.cpp b/SQCSim2021/player.cpp index e7e3152..57a2e71 100644 --- a/SQCSim2021/player.cpp +++ b/SQCSim2021/player.cpp @@ -22,19 +22,20 @@ void Player::Move(bool front, bool back, bool left, bool right, bool jump, bool static float xrotrad = 0; static bool jumped = true; static int dbljump = 0; // Peut sauter ou dasher tant que la variable est en dessous de 2. - static int dashtimeout = 0; + static float dashtimeout = 0; static float gametime = 0; if (gametime <= 360.f) gametime += elapsedTime * m_topspeed / 2; else gametime = 0; - if (dashtimeout > 0) { + if (dashtimeout > 0.f) { dash = false; - --dashtimeout; + dashtimeout -= elapsedTime; } + else dashtimeout = 0; if (jumped && !jump) jumped = false; // Anti-rebondissement du saut, pour pouvoir rebondir. - if (dash) dashtimeout = 100; + if (dash) dashtimeout = 5; if ((jump || dash) && dbljump < 2 && !jumped ) { accjmp += jump? m_jumpforce: 0.1f;