28 lines
624 B
C#
28 lines
624 B
C#
using Chickensoft.Introspection;
|
|
using Godot;
|
|
|
|
namespace Zennysoft.Game.Ma.Implementation;
|
|
|
|
public partial class PlayerLogic
|
|
{
|
|
public partial record State
|
|
{
|
|
[Meta, Id("player_logic_alive")]
|
|
public abstract partial record Alive : State, IGet<Input.PhysicsTick>, IGet<Input.Killed>
|
|
{
|
|
public virtual Transition On(in Input.PhysicsTick input)
|
|
{
|
|
var delta = input.Delta;
|
|
Output(new Output.Move((float)delta));
|
|
return ToSelf();
|
|
}
|
|
|
|
public Transition On(in Input.Killed input)
|
|
{
|
|
GD.Print("Player died");
|
|
return To<Dead>();
|
|
}
|
|
}
|
|
}
|
|
}
|