SupaLidlGame/State/Character/NPCMoveState.cs

27 lines
647 B
C#
Raw Permalink Normal View History

2022-11-13 15:42:04 -08:00
using Godot;
2023-06-03 18:21:46 -07:00
namespace SupaLidlGame.State.Character;
public partial class NPCMoveState : NPCState
2022-11-13 15:42:04 -08:00
{
2023-06-03 18:21:46 -07:00
[Export]
public CharacterState IdleState { get; set; }
2022-11-13 15:42:04 -08:00
2023-06-03 18:21:46 -07:00
public override CharacterState Process(double delta)
{
base.Process(delta);
if (Character.Direction.LengthSquared() == 0)
2022-11-13 15:42:04 -08:00
{
2023-06-03 18:21:46 -07:00
return IdleState;
2022-11-13 15:42:04 -08:00
}
2023-06-03 18:21:46 -07:00
return null;
}
2022-11-19 21:21:12 -08:00
2023-06-03 18:21:46 -07:00
public override IState<CharacterState> Enter(IState<CharacterState> prev)
{
2023-07-21 02:54:13 -07:00
Character.MovementAnimation.Play("move");
2023-07-24 00:43:21 -07:00
GD.Print("playing anim " + Character.MovementAnimation.CurrentAnimation);
2023-06-03 18:21:46 -07:00
return base.Enter(prev);
2022-11-13 15:42:04 -08:00
}
}