I am working on a basic enemy, and I want to use components to make future enemies easier to make (think MovementComponent, VisualComponent, HurtboxComponent, HealthComponent etc.).
My question is, is it better for these components to communicate trough signals directly?
(HurtboxComponent has been hit and sends a “HasBeenHit” signal. HealthComponent listens and reduces damage, VisualComponent plays a “Hit” animation, MovementComponent applies knockback and so forth)
Or it is better to have some sort of EntityManager that listens to signals from its children components?
(HurtboxComponent has been hit and sends a “HasBeenHit” signal. EntityManager listens, and calls ApplyDamage on HealthComponent, PlayHitAnimation on VisualComponent, ApplyKnockback on MovementComponent and so forth)