martindevans / Myre

An XNA game engine
http://martindevans.me/tags/#myre-ref
MIT License
12 stars 3 forks source link

Add a new particle system #3

Closed martindevans closed 10 years ago

martindevans commented 10 years ago

The current particle system has emitters attached to entities and every emitter has a particle system associated with it. This is fine for long lived emitters (as used in the GraphicsTests demo scene) but totally sucks for short lived entities:

Separate emitters (a behaviour) and systems (a service). You can initialise a system with the service and then the emitters grab that system from the service and use it. This means constructing the behaviour is much quicker, emitters of the same "type" use the same particle system behind the scenes and when an entity dies any particles it created persist for as long as necessary,