add initial project files and configurations, including EventBus, systems, and resources
This commit is contained in:
23
Code/Systems/PlayerInputSystem.cs
Normal file
23
Code/Systems/PlayerInputSystem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Godot;
|
||||
using MaxEffort.Code.Core;
|
||||
|
||||
namespace MaxEffort.Code.Systems;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class PlayerInputSystem : Node
|
||||
{
|
||||
private const string LiftAction = "lift_action";
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Input.IsActionPressed(LiftAction))
|
||||
{
|
||||
EventBus.PublishLiftEffortApplied((float)delta);
|
||||
}
|
||||
|
||||
if (Input.IsActionJustReleased(LiftAction))
|
||||
{
|
||||
EventBus.PublishFocusRelease();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user