This commit is contained in:
2026-01-31 23:24:13 +02:00
parent be0c819c8b
commit 12c1360ae7
58 changed files with 1902 additions and 238 deletions
+26
View File
@@ -0,0 +1,26 @@
using System;
using Godot;
public partial class Enemy : PathFollow2D
{
[Export] public EnemyType Type;
[Export] public Health Health;
public event Action<Enemy> Died;
public override void _Ready()
{
Health.Death += _ => Died?.Invoke(this);
}
public void ResetEnemy()
{
GlobalPosition = Vector2.Zero;
Rotation = 0f;
Visible = true;
ProcessMode = ProcessModeEnum.Inherit;
Health.Reset();
// reset velocity, animation, AI, etc here
}
}