Compare commits

..

No commits in common. "3d1de388b8a14d49cf2c5fbb203ed9107e61f417" and "8f79bb86808c9376623201c0e68f472be9bb9325" have entirely different histories.

3 changed files with 8 additions and 3 deletions

View File

@ -13,9 +13,8 @@ namespace SemiColinGames {
public int Top { get => bbox.Top; } public int Top { get => bbox.Top; }
public Point HalfSize { get => new Point(Width / 2, Height / 2); } public Point HalfSize { get => new Point(Width / 2, Height / 2); }
private readonly Random random = new Random();
private float shakeTime = 0.0f; private float shakeTime = 0.0f;
private Random random = new Random();
public Matrix Projection { public Matrix Projection {
get => Matrix.CreateOrthographicOffCenter(Left, Left + Width, Height, 0, -1, 1); get => Matrix.CreateOrthographicOffCenter(Left, Left + Width, Height, 0, -1, 1);

View File

@ -52,7 +52,7 @@ namespace SemiColinGames {
private const int spriteCenterYOffset = 2; private const int spriteCenterYOffset = 2;
private readonly Vector2 eyeOffset = new Vector2(4, -3); private readonly Vector2 eyeOffset = new Vector2(4, -3);
private readonly FSM<NPC> fsm; private FSM<NPC> fsm;
public NPC(Point position, int facing) { public NPC(Point position, int facing) {
Position = position; Position = position;

View File

@ -31,6 +31,7 @@ namespace SemiColinGames {
private int swordSwingNum = 0; private int swordSwingNum = 0;
private const int swordSwingMax = 6; private const int swordSwingMax = 6;
private float ySpeed = 0; private float ySpeed = 0;
private double jumpTime = 0;
private float invincibilityTime = 0; private float invincibilityTime = 0;
public Player(Point position, int facing) { public Player(Point position, int facing) {
@ -138,6 +139,11 @@ namespace SemiColinGames {
jumps = 1; jumps = 1;
ySpeed = -0.0001f; ySpeed = -0.0001f;
Debug.AddRect(Box(position), Color.Cyan); 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 { } else {
jumps = 0; jumps = 0;
Debug.AddRect(Box(position), Color.Orange); Debug.AddRect(Box(position), Color.Orange);