|
|
@ -22,7 +22,6 @@ namespace SemiColinGames { |
|
|
|
private double swordSwingTime = 0; |
|
|
|
private double jumpTime = 0; |
|
|
|
private float ySpeed = 0; |
|
|
|
private float totalModelTime = 0; |
|
|
|
|
|
|
|
public Player(Texture2D texture) { |
|
|
|
this.texture = texture; |
|
|
@ -35,7 +34,6 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
|
|
|
|
public void Update(float modelTime, History<Input> input, List<Rectangle> collisionTargets) { |
|
|
|
totalModelTime += modelTime; |
|
|
|
Point oldPosition = position; |
|
|
|
Vector2 movement = HandleInput(modelTime, input); |
|
|
|
position = new Point((int) (oldPosition.X + movement.X), (int) (oldPosition.Y + movement.Y)); |
|
|
@ -130,7 +128,7 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
|
|
|
|
private int SpriteIndex(Pose pose) { |
|
|
|
int frameNum = ((int) (totalModelTime * 1000) / 125) % 4; |
|
|
|
int frameNum = (int) Clock.ModelTime.TotalMilliseconds / 125 % 4; |
|
|
|
if (frameNum == 3) { |
|
|
|
frameNum = 1; |
|
|
|
} |
|
|
|