New answers tagged component-based
Your HudLayer could contain a System HUDSystem where your entities eventually register their components. The HUDSystem can then track changes from the registered entities.
My interpretation of this comment by Adam Martin, discussing how to model an airplane in an entity system -- Since an entity is formally just “a name”, a component can refer to other entities easily. Personally, I’d be tempted to have a separate “plane” entity that had a “PlaneParts” component that was just a list of the names of the other entities ...
In ECS everything is broken down to components that describe functions. A weapon is a physical item so one component will be a physical position. If it is on the ground or thrown at an enemy (sword / throwing knife) then you need the physical position component to decide if it was picked up or hit something (e.g. wall or monster). When a weapon is held you ...
Put this functionality wherever you want. Sure strict and "pure" ECS says don't put things in your components in order to avoid OOP. This usually just hinders everyone still learning from thinking about how to write useful code. You clearly understand how to implement a form of messaging, so just use it and don't waste time trying to adhere to some ...
Top 50 recent answers are included