BOING!!!!!!
This commit is contained in:
@@ -226,16 +226,14 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
void Bounce()
|
||||
{
|
||||
Vector2 reflect = new Vector2(-(saveVelocity.x),-(saveVelocity.y) * bonk);
|
||||
print("x vel: " + saveVelocity.x);
|
||||
print("y vel: " + saveVelocity.y);
|
||||
Vector2 reflect = new Vector2(saveVelocity.x,-(saveVelocity.y) * bonk);
|
||||
_rb.AddForce(reflect, ForceMode2D.Impulse);
|
||||
print("boing");
|
||||
}
|
||||
|
||||
void Water()
|
||||
{
|
||||
if(_rb.velocity.y < 0.2f)
|
||||
if(Mathf.Abs(_rb.velocity.y) < 2f)
|
||||
{
|
||||
saveVelocity = Vector2.zero;
|
||||
isInWater = true;
|
||||
@@ -244,7 +242,6 @@ public class PlayerBehavior : MonoBehaviour
|
||||
else
|
||||
{
|
||||
saveVelocity = _rb.velocity;
|
||||
//_rb.AddForce(saveVelocity, ForceMode2D.Force);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -310,10 +310,10 @@ public class PlayerMovement : MonoBehaviour
|
||||
//Caps maximum fall speed, so when falling over large distances we don't accelerate to insanely high speeds
|
||||
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFallSpeed));
|
||||
}
|
||||
else if (playerBehavior.isInWater)
|
||||
/*else if (playerBehavior.isInWater)
|
||||
{
|
||||
SetGravityScale(0);
|
||||
}
|
||||
}*/
|
||||
else
|
||||
{
|
||||
//Default gravity if standing on a platform or moving upwards
|
||||
|
||||
Reference in New Issue
Block a user