Files
fgj-26/Scripts/Enemies/Enemy.cs
T
2026-01-31 23:25:02 +02:00

26 lines
533 B
C#

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
}
}