| 239 | class ParticleSystem : public ex::System<ParticleSystem> { |
| 240 | public: |
| 241 | void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { |
| 242 | ex::ComponentHandle<Particle> particle; |
| 243 | for (ex::Entity entity : es.entities_with_components(particle)) { |
| 244 | particle->alpha -= particle->d * dt; |
| 245 | if (particle->alpha <= 0) { |
| 246 | entity.destroy(); |
| 247 | } else { |
| 248 | particle->colour.a = particle->alpha; |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | }; |
| 253 | |
| 254 |
nothing calls this directly
no test coverage detected