|
|
|
|
@ -6,7 +6,7 @@ public partial class MoveState : State {
|
|
|
|
|
private Player2 player;
|
|
|
|
|
public override void _Ready() {
|
|
|
|
|
player = GetParent<Player2>();
|
|
|
|
|
player.Playback.Travel("Walk");
|
|
|
|
|
player.Playback.Travel("move");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void _PhysicsProcess(double delta) {
|
|
|
|
|
@ -14,12 +14,12 @@ public partial class MoveState : State {
|
|
|
|
|
|
|
|
|
|
if (player.Direction != Vector3.Zero)
|
|
|
|
|
{
|
|
|
|
|
player.ChangeState("Walking");
|
|
|
|
|
player.ChangeState("move");
|
|
|
|
|
velocity.X = player.Direction.X * Player2.SPEED;
|
|
|
|
|
velocity.Z = player.Direction.Z * Player2.SPEED;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
player.ChangeState("Idle");
|
|
|
|
|
player.ChangeState("idle");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player.Velocity = velocity;
|
|
|
|
|
|