This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-crawler-demo/scripts/Player.cs
2020-10-26 00:50:16 -04:00

34 lines
500 B
C#

using Godot;
using System;
public class Player : Creature
{
[Signal]
public delegate void UpdatePlayerGuiHandler(Player player);
public override void _Ready()
{
// Update GUI on stat changes
health.statUpdated += UpdateGui;
}
public override void _Process(float delta)
{
ProcessMovement();
}
protected void ProcessMovement()
{
Move(InputHandler.MovementInput());
}
protected void UpdateGui(int newValue = -1)
{
EmitSignal(nameof(UpdatePlayerGuiHandler), this);
}
}