|
|
@ -9,16 +9,15 @@ namespace Jumpy { |
|
|
|
enum Pose { Walking, Standing, Crouching, Stretching, SwordSwing, Jumping }; |
|
|
|
enum AirState { Jumping, Ground }; |
|
|
|
|
|
|
|
private Texture2D texture; |
|
|
|
private const int spriteSize = 48; |
|
|
|
private const int spriteWidth = 8; |
|
|
|
private const int spriteWidth = 7; |
|
|
|
private const int moveSpeed = 200; |
|
|
|
private const int jumpSpeed = 600; |
|
|
|
private const int gravity = 2000; |
|
|
|
private Texture2D texture; |
|
|
|
private const int groundLevel = Camera.Height - spriteSize / 2; |
|
|
|
|
|
|
|
// TODO: stop assuming 1920x1080.
|
|
|
|
private const int groundLevel = 180 - spriteSize / 2 - 10; |
|
|
|
private Point position = new Point(200, groundLevel); |
|
|
|
private Point position = new Point(Camera.Width / 2, groundLevel); |
|
|
|
private Facing facing = Facing.Right; |
|
|
|
private Pose pose = Pose.Standing; |
|
|
|
private AirState airState = AirState.Ground; |
|
|
@ -82,7 +81,7 @@ namespace Jumpy { |
|
|
|
pose = Pose.Jumping; |
|
|
|
} |
|
|
|
|
|
|
|
position.X = (int) Math.Min(Math.Max(position.X, 0 + spriteWidth), 320 - spriteWidth); |
|
|
|
position.X = Math.Min(Math.Max(position.X, 0 + spriteWidth), Camera.Width - spriteWidth); |
|
|
|
} |
|
|
|
|
|
|
|
private Point spritePosition(Pose pose, GameTime time) { |
|
|
|