hi sammy
This commit is contained in:
@@ -5,8 +5,6 @@ using UnityEngine.InputSystem;
|
||||
|
||||
public class PlayerBehavior : MonoBehaviour
|
||||
{
|
||||
public PlayerData Data;
|
||||
|
||||
[Header("Physics:")]
|
||||
private float _hInput;
|
||||
private Rigidbody2D _rb;
|
||||
@@ -29,11 +27,11 @@ public class PlayerBehavior : MonoBehaviour
|
||||
private float currentDash = 0.0f;
|
||||
Vector2 dashVec;
|
||||
// things for bounce
|
||||
public float reflectForce = 1.5f;
|
||||
public float reflectForce = 1.1f;
|
||||
private Vector2 saveVelocity;
|
||||
private bool isInWater = false;
|
||||
private bool hasBounced = false;
|
||||
public float waterGravity = 0.3f;
|
||||
public float waterGravity = 0.5f;
|
||||
|
||||
[Header("Cymbals:")]
|
||||
private float cymbalActiveTime = 0f;
|
||||
@@ -132,7 +130,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
}
|
||||
currentDash += dashInc;
|
||||
}
|
||||
else if (!isInWater)
|
||||
else if ((currentDash == dashTime || currentDash > dashTime) && !isInWater)
|
||||
{
|
||||
isDash = false;
|
||||
currentDash = 0.0f;
|
||||
@@ -273,7 +271,8 @@ public class PlayerBehavior : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
reflect = new Vector2(saveVelocity.x * 1.1f, -(saveVelocity.y) * reflectForce);
|
||||
reflect = new Vector2(saveVelocity.x * reflectForce, -(saveVelocity.y) * reflectForce);
|
||||
//reflect = new Vector2(saveVelocity.x * 1.1f, -(saveVelocity.y) * reflectForce);
|
||||
hasBounced = true;
|
||||
}
|
||||
_rb.AddForce(reflect, ForceMode2D.Impulse);
|
||||
@@ -283,6 +282,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
void Water()
|
||||
{
|
||||
print("water dash " + isDash);
|
||||
if(isDash)
|
||||
{
|
||||
saveVelocity = _rb.velocity;
|
||||
|
||||
Reference in New Issue
Block a user