This commit is contained in:
allylikesfrogs
2023-05-05 21:37:59 -07:00
parent 89ae237941
commit a1cfe23993
3 changed files with 92 additions and 92 deletions

View File

@@ -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;

View File

@@ -228,7 +228,7 @@ public class PlayerMovement : MonoBehaviour
_isJumpFalling = false;
bool inCoyoteTime = LastOnGroundTime > 0;
print("coyote time: " + inCoyoteTime);
//print("coyote time: " + inCoyoteTime);
Jump();