Browse Source

remove now-unneeded groundLevel constant

GitOrigin-RevId: 91e2c3320a
master
Colin McMillen 4 years ago
parent
commit
e7006525be
  1. 6
      Jumpy.Shared/Player.cs

6
Jumpy.Shared/Player.cs

@ -17,7 +17,6 @@ namespace Jumpy {
private const int moveSpeed = 200;
private const int jumpSpeed = 600;
private const int gravity = 2000;
private const int groundLevel = 10000;
private Point position = new Point(Camera.Width / 2, 10);
private Facing facing = Facing.Right;
@ -130,11 +129,6 @@ namespace Jumpy {
if (airState == AirState.Jumping || airState == AirState.Falling) {
position.Y += (int) (ySpeed * time.ElapsedGameTime.TotalSeconds);
ySpeed += gravity * (float) time.ElapsedGameTime.TotalSeconds;
if (position.Y > groundLevel) {
position.Y = groundLevel;
ySpeed = 0;
airState = AirState.Ground;
}
}
if (airState == AirState.Jumping && pose != Pose.SwordSwing) {
pose = Pose.Jumping;

Loading…
Cancel
Save