|
@ -5,7 +5,7 @@ using System.Collections.Generic; |
|
|
|
|
|
|
|
|
namespace SemiColinGames { |
|
|
namespace SemiColinGames { |
|
|
public class Player { |
|
|
public class Player { |
|
|
private enum Pose { Walking, Standing, Crouching, Stretching, SwordSwing, Jumping }; |
|
|
|
|
|
|
|
|
private enum Pose { Walking, Standing, SwordSwing, Jumping }; |
|
|
|
|
|
|
|
|
private const int moveSpeed = 180; |
|
|
private const int moveSpeed = 180; |
|
|
private const int jumpSpeed = -600; |
|
|
private const int jumpSpeed = -600; |
|
@ -164,10 +164,6 @@ namespace SemiColinGames { |
|
|
pose = Pose.Jumping; |
|
|
pose = Pose.Jumping; |
|
|
} else if (inputMovement.X != 0) { |
|
|
} else if (inputMovement.X != 0) { |
|
|
pose = Pose.Walking; |
|
|
pose = Pose.Walking; |
|
|
} else if (input[0].Motion.Y > 0) { |
|
|
|
|
|
pose = Pose.Stretching; |
|
|
|
|
|
} else if (input[0].Motion.Y < 0) { |
|
|
|
|
|
pose = Pose.Crouching; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
pose = Pose.Standing; |
|
|
pose = Pose.Standing; |
|
|
} |
|
|
} |
|
@ -206,8 +202,6 @@ namespace SemiColinGames { |
|
|
// TODO: make a proper animation class & FSM-driven animations.
|
|
|
// TODO: make a proper animation class & FSM-driven animations.
|
|
|
return Sprites.Ninja.GetTextureSource( |
|
|
return Sprites.Ninja.GetTextureSource( |
|
|
"attack_sword", 0.3 - swordSwingTime); |
|
|
"attack_sword", 0.3 - swordSwingTime); |
|
|
case Pose.Crouching: |
|
|
|
|
|
case Pose.Stretching: |
|
|
|
|
|
case Pose.Standing: |
|
|
case Pose.Standing: |
|
|
default: |
|
|
default: |
|
|
return Sprites.Ninja.GetTextureSource("idle", time); |
|
|
return Sprites.Ninja.GetTextureSource("idle", time); |
|
|