hello again
This commit is contained in:
parent
36e5300300
commit
ed72a093fb
@ -20,6 +20,10 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
|
|
||||||
[Header("Clarinet:")]
|
[Header("Clarinet:")]
|
||||||
bool unlockedClarinet;
|
bool unlockedClarinet;
|
||||||
|
[SerializeField] private float dashMult = 2;
|
||||||
|
[SerializeField] private float maxDashTime = 1.0f;
|
||||||
|
[SerializeField] private float dashStopSpeed = 0.1f;
|
||||||
|
private float currentDashTime;
|
||||||
|
|
||||||
[Header("Grappling:")]
|
[Header("Grappling:")]
|
||||||
[SerializeField] public Tutorial_GrapplingGun grapplingGun;
|
[SerializeField] public Tutorial_GrapplingGun grapplingGun;
|
||||||
@ -58,6 +62,8 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
|
|
||||||
void Start() {
|
void Start() {
|
||||||
gameUI.ResetInstrumentUI();
|
gameUI.ResetInstrumentUI();
|
||||||
|
// for clarinet
|
||||||
|
currentDashTime = maxDashTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@ -92,8 +98,19 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (playerInput.actions["ClarinetDive"].WasPressedThisFrame())
|
if (playerInput.actions["ClarinetDive"].WasPressedThisFrame())
|
||||||
{
|
{
|
||||||
UseClarinet();
|
currentDashTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
if (!playerController.IsGrounded())
|
||||||
|
{
|
||||||
|
Vector2 dashSpeed = new Vector2(1f,1f) * dashMult;
|
||||||
|
if (currentDashTime < maxDashTime)
|
||||||
|
{
|
||||||
|
_rb.AddForce(dashSpeed, ForceMode2D.Force);
|
||||||
|
currentDashTime += dashStopSpeed;
|
||||||
|
print("cdt " + currentDashTime);
|
||||||
|
}
|
||||||
|
// print("Clarinet pressed!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +147,7 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlipScale() { // DOENST WORK RIGHT
|
void FlipScale() { // DOENST WORK RIGHT (that's so sad for you)
|
||||||
Vector3 currentScale = this.gameObject.transform.localScale;
|
Vector3 currentScale = this.gameObject.transform.localScale;
|
||||||
currentScale.x *= -1;
|
currentScale.x *= -1;
|
||||||
this.gameObject.transform.localScale = currentScale;
|
this.gameObject.transform.localScale = currentScale;
|
||||||
@ -140,17 +157,6 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
|
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseClarinet()
|
|
||||||
{
|
|
||||||
// if key pressed J
|
|
||||||
// launch down at 45 degree angle
|
|
||||||
// use: player facing, velocity, start dash function, end dash function
|
|
||||||
if (!playerController.IsGrounded())
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThrowTambourine() {
|
void ThrowTambourine() {
|
||||||
if (unlockedTambourine && hasTambourine && !grapplingRope.isGrappling)
|
if (unlockedTambourine && hasTambourine && !grapplingRope.isGrappling)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user