Allow particle frequency smaller than delta

This commit is contained in:
samme 2022-05-30 10:55:30 -07:00
parent dfaa91b48c
commit f393cb9c43

View file

@ -2046,12 +2046,12 @@ var ParticleEmitter = new Class({
{
this._counter -= delta;
if (this._counter <= 0)
while (this._counter <= 0)
{
this.emitParticle();
// counter = frequency - remained from previous delta
this._counter = (this.frequency - Math.abs(this._counter));
this._counter += this.frequency;
}
}
},