From 6c7e2ac133986efa57b43df52a5498c6f7efcf75 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 26 Aug 2025 22:59:57 -0300 Subject: AI --- scripts/actors/AI/BaseAI.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/actors/AI/BaseAI.cs (limited to 'scripts/actors/AI/BaseAI.cs') 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(); + } + + public abstract void Perform(); + + public Godot.Collections.Array GetPathTo(Vector2I destination) { + Godot.Collections.Array list = []; + Vector2[] path = body.Map_Data.Pathfinder.GetPointPath(body.GridPosition, destination); + list.AddRange(path); + return list; + } +} \ No newline at end of file -- cgit v1.2.3