diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-26 22:59:57 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-26 22:59:57 -0300 |
| commit | 6c7e2ac133986efa57b43df52a5498c6f7efcf75 (patch) | |
| tree | 8404bfd3415a8dfcf7073191cbfdf58cc7c905ed /scripts/actors/AI/BaseAI.cs | |
| parent | a3103718796a472da76838bf6fd72ba5d8409d79 (diff) | |
AI
Diffstat (limited to 'scripts/actors/AI/BaseAI.cs')
| -rw-r--r-- | scripts/actors/AI/BaseAI.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/actors/AI/BaseAI.cs b/scripts/actors/AI/BaseAI.cs new file mode 100644 index 0000000..f9b5387 --- /dev/null +++ b/scripts/actors/AI/BaseAI.cs @@ -0,0 +1,20 @@ +using Godot; + +public abstract partial class BaseAI : Node { + protected Actor body; + + public override void _Ready() + { + base._Ready(); + body = GetParent<Actor>(); + } + + public abstract void Perform(); + + public Godot.Collections.Array<Vector2> GetPathTo(Vector2I destination) { + Godot.Collections.Array<Vector2> list = []; + Vector2[] path = body.Map_Data.Pathfinder.GetPointPath(body.GridPosition, destination); + list.AddRange(path); + return list; + } +}
\ No newline at end of file |
