Entity Type specific updates in entity component system
- by Nathan
I am currently familiarizing myself with the entity component paradigm.
For an example, take a collision system, that detects if entities collide and if they do let them explode.
So the collision system has to test collision based on the position component and then set the state of those entities to exploding.
But what if the "effect" (setting the state to exploding) is different for different entities? For example, a ship fades out while for an asteroid a particle system must be created.
Since entities and components are only data, this must happen in some system.
The collision system could do it, but then it must switch over the entity type, which in my opinion is a cumbersome and difficult to extend solution.
So how do I trigger "entity type dependend" updates on an entity?