32 lines
712 B
C#
32 lines
712 B
C#
using Godot;
|
|
using System;
|
|
using DungeonRPG.Scripts.General;
|
|
|
|
public partial class PlayerIdleState : PlayerState
|
|
{
|
|
|
|
|
|
public override void _PhysicsProcess(double delta)
|
|
{
|
|
if (characterNode.Direction != Vector2.Zero)
|
|
{
|
|
characterNode.StateMachine.SwitchState<PlayerMoveState>();
|
|
}
|
|
}
|
|
|
|
public override void _Input(InputEvent @event)
|
|
{
|
|
if (Input.IsActionJustPressed(GameConstants.INPUT_DASH))
|
|
{
|
|
characterNode.StateMachine.SwitchState<PlayerDashState>();
|
|
}
|
|
}
|
|
|
|
protected override void EnterState()
|
|
{
|
|
base.EnterState();
|
|
|
|
characterNode.AnimatedSprite.Play(GameConstants.ANIM_IDLE);
|
|
}
|
|
}
|