more from me

This commit is contained in:
allylikesfrogs 2023-05-03 09:37:22 -07:00
parent f1e2de295f
commit 90e2f1ae26

View File

@ -332,6 +332,10 @@ public class PlayerMovement : MonoBehaviour
if (trumpet == 0) { if (trumpet == 0) {
gameUI.ToggleTrumpet(false); gameUI.ToggleTrumpet(false);
} }
if (isDashing)
{
gameUI.ToggleClarinet(false);
}
#endregion #endregion
} }
} }
@ -390,6 +394,7 @@ public class PlayerMovement : MonoBehaviour
#region RUN METHODS #region RUN METHODS
private void Run(float lerpAmount) private void Run(float lerpAmount)
{ {
if(!isDashing){
//Calculate the direction we want to move in and our desired velocity //Calculate the direction we want to move in and our desired velocity
float targetSpeed = _moveInput.x * Data.runMaxSpeed; float targetSpeed = _moveInput.x * Data.runMaxSpeed;
//We can reduce are control using Lerp() this smooths changes to are direction and speed //We can reduce are control using Lerp() this smooths changes to are direction and speed
@ -444,6 +449,7 @@ public class PlayerMovement : MonoBehaviour
* Time.fixedDeltaTime is by default in Unity 0.02 seconds equal to 50 FixedUpdate() calls per second * Time.fixedDeltaTime is by default in Unity 0.02 seconds equal to 50 FixedUpdate() calls per second
*/ */
} }
}
private void Turn() private void Turn()
{ {
@ -459,6 +465,7 @@ public class PlayerMovement : MonoBehaviour
#region JUMP METHODS #region JUMP METHODS
private void Jump() private void Jump()
{ {
if(!isDashing){
//Ensures we can't call Jump multiple times from one press //Ensures we can't call Jump multiple times from one press
LastPressedJumpTime = 0; LastPressedJumpTime = 0;
LastOnGroundTime = 0; LastOnGroundTime = 0;
@ -474,6 +481,7 @@ public class PlayerMovement : MonoBehaviour
RB.AddForce(Vector2.up * force, ForceMode2D.Impulse); RB.AddForce(Vector2.up * force, ForceMode2D.Impulse);
#endregion #endregion
} }
}
private void WallJump(int dir) private void WallJump(int dir)
{ {