Commit ff0e9958 by Philipp Adolf

Make dash cool down longer on collision

parent 290b428f
......@@ -21,6 +21,9 @@ public class PlayerControl : MonoBehaviour
public float dashStartSpeed = 20.0f;
public float dashEndSpeed = 8.0f;
public float dashCoolDown = 0.5f;
public float dashCollisionCoolDown = 1.5f;
[HideInInspector]
public float currentDashCoolDown = 0.0f;
// public float jumpWaitTime = 2.0;
[HideInInspector]
......@@ -77,7 +80,8 @@ public class PlayerControl : MonoBehaviour
{
//TODO abfrage " is dashing"
body.AddForce(_controller.getDirectionOfMovement() * pushForce);
//TODO set is dashing to false
lastDashStart = Time.time - dashCompletionTime;
currentDashCoolDown = dashCollisionCoolDown;
}
}
......@@ -102,6 +106,7 @@ public class PlayerControl : MonoBehaviour
{
lastDashStart = Time.time;
currentDashDirection = dashDirection;
currentDashCoolDown = dashCoolDown;
}
if (isDashing ())
......@@ -179,7 +184,7 @@ public class PlayerControl : MonoBehaviour
private bool canDash ()
{
return getDashTime() >= dashCompletionTime + dashCoolDown;
return getDashTime() >= dashCompletionTime + currentDashCoolDown;
}
/*==========Power Ups // Bullet management ===*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment