diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 19:32:36 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 19:32:36 -0300 |
| commit | ca782d7310f2df854a8727535ac92337c85ed445 (patch) | |
| tree | 7df571c01d48cac56fb8362d4d091bdd2a55c09a /scripts/Actor.cs | |
| parent | adb86dd1725276457c13e9a4d37372fda628dea3 (diff) | |
Gigantesco refactor
Diffstat (limited to 'scripts/Actor.cs')
| -rw-r--r-- | scripts/Actor.cs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/scripts/Actor.cs b/scripts/Actor.cs deleted file mode 100644 index d196940..0000000 --- a/scripts/Actor.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Godot; - -public abstract partial class Actor : Node2D { - static int baseWalkCost = 10; - [Export] - public TileMapLayer Map { get; set; } - [Signal] - public delegate void actionPerformedEventHandler(); - - [Export] - public int Energy { get; set; } = 0; - [Export] - public int Speed { get; protected set; } = 10; - - protected void Walk(Vector2I offset) { - Vector2I toMovePos = Map.LocalToMap(Position); - toMovePos += offset; - - TileData tile = Map.GetCellTileData(toMovePos); - - if (tile != null) { - if ((bool) tile.GetCustomData("isWalkable")) { - Position = Map.MapToLocal(toMovePos); - } - } - - Energy -= baseWalkCost; - EndAction(); - } - - protected virtual void EndAction() { - EmitSignal(SignalName.actionPerformed); - } - - public abstract void PerformAction(); -}
\ No newline at end of file |
