Basic pathfinding working for crying ghosts

This commit is contained in:
2026-01-17 23:37:33 -06:00
parent dd4ce5fcf4
commit 3a63bb6709
46 changed files with 691 additions and 34 deletions

View File

@@ -3,8 +3,10 @@ using Godot;
public partial class ProjectileBase : Area2D
{
[Export] public float Speed { get; set; }
[Export] public float Lifetime { get; set; }
protected CharacterBase? Character;
protected float Age { get; private set; } = 0f;
public override void _Ready()
{
@@ -14,6 +16,16 @@ public partial class ProjectileBase : Area2D
}
}
public override void _Process(double delta)
{
Age += (float)delta;
if (Age >= Lifetime)
{
QueueFree();
}
}
void OnBodyEntered(Node body)
{
if (body == Character)