This commit is contained in:
allylikesfrogs 2023-05-05 20:40:06 -07:00
parent b3ab81f7eb
commit 7ecafe5fb2
3 changed files with 1761 additions and 360 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -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()