Browse Source

Player: tweak constants, track jump hangtime.

GitOrigin-RevId: 868003a326
master
Colin McMillen 4 years ago
parent
commit
cf5167fba7
  1. 10
      Shared/Player.cs

10
Shared/Player.cs

@ -10,7 +10,7 @@ namespace SemiColinGames {
private const int moveSpeed = 180;
private const int jumpSpeed = -600;
private const int gravity = 2400;
private const int gravity = 1600;
// Details of the sprite image.
// player_1x is 48 x 48, yOffset=5, halfSize=(7, 14)
@ -23,7 +23,7 @@ namespace SemiColinGames {
// Position is tracked at the Player's center. The Player's bounding box is a rectangle
// centered at that point and extending out by halfSize.X and halfSize.Y.
private Point position = new Point(64, 16 * 13);
private Point position = new Point(64, 16 * 12);
private Vector2 halfSize = new Vector2(11, 24);
private Vector2 eyeOffsetStanding = new Vector2(7, -14);
private Vector2 eyeOffsetWalking = new Vector2(15, -7);
@ -34,6 +34,7 @@ namespace SemiColinGames {
private int swordSwingNum = 0;
private const int swordSwingMax = 6;
private float ySpeed = 0;
private double jumpTime = 0;
public Player() {
}
@ -118,6 +119,11 @@ namespace SemiColinGames {
jumps = 1;
ySpeed = -0.0001f;
// Debug.AddRect(Box(position), Color.Cyan);
double jumpElapsed = Clock.ModelTime.TotalSeconds - jumpTime;
if (jumpElapsed > 0.2) {
Debug.WriteLine("jump time: " + jumpElapsed);
}
jumpTime = Clock.ModelTime.TotalSeconds;
} else {
jumps = 0;
// Debug.AddRect(Box(position), Color.Orange);

Loading…
Cancel
Save