SupaLidlGame/State/Character/NPCMoveState.cs

27 lines
632 B
C#
Raw Normal View History

2022-11-13 15:42:04 -08:00
using Godot;
2023-05-25 15:28:33 -07:00
namespace SupaLidlGame.State.Character
2022-11-13 15:42:04 -08:00
{
public partial class NPCMoveState : NPCState
{
[Export]
public CharacterState IdleState { get; set; }
public override CharacterState Process(double delta)
{
base.Process(delta);
if (Character.Direction.LengthSquared() == 0)
{
return IdleState;
}
return null;
}
2022-11-19 21:21:12 -08:00
2023-05-25 15:28:33 -07:00
public override IState<CharacterState> Enter(IState<CharacterState> prev)
2022-11-19 21:21:12 -08:00
{
Character.Sprite.Play("move");
2023-05-25 15:28:33 -07:00
return base.Enter(prev);
2022-11-19 21:21:12 -08:00
}
2022-11-13 15:42:04 -08:00
}
}