This commit is contained in:
allylikesfrogs 2023-05-04 17:16:43 -07:00
parent ce71c20acb
commit 608173221e

View File

@ -19,12 +19,11 @@ public class PlayerBehavior : MonoBehaviour
[Header("Clarinet:")] [Header("Clarinet:")]
bool unlockedClarinet; bool unlockedClarinet;
private float currentDashTime;
public bool isDash = false; public bool isDash = false;
public float bonk = 2f; public float bonk = 2f;
private Vector2 saveVelocity; private Vector2 saveVelocity;
public bool isInWater = false; public bool isInWater = false;
public float dashForce = 1.5f; public float dashForce = 1.2f;
[Header("Grappling:")] [Header("Grappling:")]
[SerializeField] public Tutorial_GrapplingGun grapplingGun; [SerializeField] public Tutorial_GrapplingGun grapplingGun;
@ -62,8 +61,6 @@ public class PlayerBehavior : MonoBehaviour
void Start() void Start()
{ {
gameUI.UpdateInstrumentUI(); gameUI.UpdateInstrumentUI();
// for clarinet
currentDashTime = maxDashTime;
} }
void Update() void Update()
@ -98,6 +95,8 @@ public class PlayerBehavior : MonoBehaviour
{ {
isDash = true; isDash = true;
playerInput.DeactivateInput(); playerInput.DeactivateInput();
// set so if in water dash will still be true
// otherwise turn dash off
} }
if (!playerController.IsGrounded() && isDash) if (!playerController.IsGrounded() && isDash)
{ {
@ -224,7 +223,7 @@ public class PlayerBehavior : MonoBehaviour
{ {
Vector2 reflect = new Vector2(saveVelocity.x,-(saveVelocity.y) * bonk); Vector2 reflect = new Vector2(saveVelocity.x,-(saveVelocity.y) * bonk);
_rb.AddForce(reflect, ForceMode2D.Impulse); _rb.AddForce(reflect, ForceMode2D.Impulse);
print("boing"); reflect = Vector2.zero;
} }
void Water() void Water()
@ -233,7 +232,6 @@ public class PlayerBehavior : MonoBehaviour
{ {
saveVelocity = Vector2.zero; saveVelocity = Vector2.zero;
isInWater = true; isInWater = true;
print("buoy");
} }
else else
{ {