dash
This commit is contained in:
parent
b3ab81f7eb
commit
7ecafe5fb2
File diff suppressed because it is too large
Load Diff
@ -23,16 +23,17 @@ public class PlayerBehavior : MonoBehaviour
|
||||
bool unlockedClarinet;
|
||||
// things for dash
|
||||
private bool isDash = false;
|
||||
public float dashForce = 1.2f;
|
||||
public float dashForce = 1.3f;
|
||||
private float dashTime = 1.0f;
|
||||
private float dashInc = 0.1f;
|
||||
private float currentDash = 0.0f;
|
||||
Vector2 dashVec;
|
||||
// things for bounce
|
||||
public float reflectForce = 2f;
|
||||
public float reflectForce = 1.5f;
|
||||
private Vector2 saveVelocity;
|
||||
private bool isInWater = false;
|
||||
private bool hasBounced = false;
|
||||
public float waterGravity = 0.3f;
|
||||
|
||||
[Header("Cymbals:")]
|
||||
private float cymbalActiveTime = 0f;
|
||||
@ -272,7 +273,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
reflect = new Vector2(saveVelocity.x, -(saveVelocity.y) * reflectForce);
|
||||
reflect = new Vector2(saveVelocity.x * 1.1f, -(saveVelocity.y) * reflectForce);
|
||||
hasBounced = true;
|
||||
}
|
||||
_rb.AddForce(reflect, ForceMode2D.Impulse);
|
||||
@ -288,17 +289,8 @@ public class PlayerBehavior : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
playerController.FloatGravity();
|
||||
playerController.FloatGravity(waterGravity);
|
||||
}
|
||||
/*
|
||||
if (Mathf.Abs(_rb.velocity.y) < 2f)
|
||||
{
|
||||
saveVelocity = Vector2.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
saveVelocity = _rb.velocity;
|
||||
}*/
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col)
|
||||
|
@ -563,9 +563,9 @@ public class PlayerMovement : MonoBehaviour
|
||||
return (Physics2D.OverlapBox(new Vector2(this.transform.position.x, this.transform.position.y - _groundCheckOffset), _groundCheckSize, 0, _groundLayer) && !IsJumping);
|
||||
}
|
||||
|
||||
public void FloatGravity()
|
||||
public void FloatGravity(float grav)
|
||||
{
|
||||
Data.maxFallSpeed = 0.1f;
|
||||
Data.maxFallSpeed = grav;
|
||||
}
|
||||
|
||||
public void EndFloatGravity()
|
||||
|
Loading…
Reference in New Issue
Block a user