diff --git a/Assets/Scripts/PlayerBehavior.cs b/Assets/Scripts/PlayerBehavior.cs index efb98a8..c1af501 100644 --- a/Assets/Scripts/PlayerBehavior.cs +++ b/Assets/Scripts/PlayerBehavior.cs @@ -226,7 +226,7 @@ public class PlayerBehavior : MonoBehaviour void LetGoOfGrapple() { bool currentlyPaused = StateController.Instance.isPaused; if (grapplingRope.isGrappling && !currentlyPaused) { - print("currently paused is " + currentlyPaused + ", releasing grapple"); + // print("currently paused is " + currentlyPaused + ", releasing grapple"); if (tambourine != null) { tambourine.GetComponent().DestroySelf(); } @@ -362,7 +362,10 @@ public class PlayerBehavior : MonoBehaviour IEnumerator DestroyPlayer() { if (playerIsAlive) { - print("destroyPlayer called"); + if (grapplingRope.isGrappling) { + LetGoOfGrapple(); + } + // print("destroyPlayer called"); playerIsAlive = false; audioSource.clip = deathSound; audioSource.loop = false; @@ -371,15 +374,8 @@ public class PlayerBehavior : MonoBehaviour // animate animator.Play("Die"); - // yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length); yield return new WaitForSeconds(audioSource.clip.length); - // this.stateController.SetDeathCanvasActive(true); - - if (grapplingRope.isGrappling) { - LetGoOfGrapple(); - } - // destroy all tambourines GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine"); print("tambs found: " + currentTambourines.Length); diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index ac1a26a..d84696d 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -287,15 +287,14 @@ public class PlayerMovement : MonoBehaviour #region Calculate AccelRate float accelRate; - //Gets an acceleration value based on if we are accelerating (includes turning) - //or trying to decelerate (stop). As well as applying a multiplier if we're air borne. - if (LastOnGroundTime > 0) { + // accelerate or decelerate + if (LastOnGroundTime > 0) { // if grounded accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount : Data.runDeccelAmount; } - else if (wasGrappling) { + else if (wasGrappling) { // if grappling accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * (Data.deccelInAir / 5); } - else { + else { // if in air accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * Data.deccelInAir; } #endregion