update method
void
update(
- double deltaTime,
- Size size
)
override
Implementation
@override
void update(double deltaTime, Size size) {
_buildGradientRect(size);
_buildGradients();
_buildPaints(size);
fireGradient.update(deltaTime);
smokeGradient.update(deltaTime);
lightGradient.update(deltaTime);
for (int i = 0; i < fireParticlesPerTick; i++) {
_spawnFlameParticle(size);
}
for (int i = 0; i < smokeParticlesPerTick; i++) {
_spawnSmokeParticle(size);
}
for (EParticle eParticle in _flameParticleList) {
eParticle.update(deltaTime, size);
if (eParticle.radius <= 0) {
_flameParticleList.remove(eParticle);
}
}
for (EParticle eParticle in _smokeParticleList) {
eParticle.update(deltaTime, size);
//determines how big the smoke particle can get
if (eParticle.radius >= 3 * startSize.getAbsoluteValue(size)) {
_smokeParticleList.remove(eParticle);
}
}
}