MCPcopy Create free account
hub / github.com/alecthomas/entityx / update

Method update

examples/example.cc:241–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239class ParticleSystem : public ex::System<ParticleSystem> {
240public:
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

Callers

nothing calls this directly

Calls 2

destroyMethod · 0.45

Tested by

no test coverage detected