Generic enemies

This commit is contained in:
Marco 2025-06-03 10:11:09 +02:00
commit d99c773641
55 changed files with 968 additions and 204 deletions

View file

@ -0,0 +1,16 @@
using Godot;
namespace Cirno.Scripts.Components.FSM.Enemy;
public partial class EnemyFSMAnimatedSprite : AnimatedSprite2D
{
public override void _Ready()
{
var enemyFsmProxy = this.GetParentOrNull<EnemyFSMProxy>();
if (enemyFsmProxy?.EnemyResource?.AnimationFrames != null)
{
this.SpriteFrames = enemyFsmProxy.EnemyResource.AnimationFrames;
}
}
}

View file

@ -0,0 +1 @@
uid://dathhlufbe6gr

View file

@ -27,6 +27,12 @@ public partial class EnemyFSMProxy : CharacterBody2D, IActivable
[Signal] public delegate void DeathEventHandler(EnemyFSMProxy enemy);
public void Init(EnemyResource enemyResource)
{
this.EnemyResource = enemyResource;
}
public void TriggerDeath()
{
EmitSignalDeath(this);