Closed st3v0 closed 6 years ago
Thanks!
Hmm, I must have missed something somewhere. It looks like when time starts moving forward again (after reversing for a little bit) it takes a bit of time for new particles to start being created again. Maybe the reversal of time is affecting the spawn timer...
The Emitter has
//decrease spawn timer
this._spawnTimer -= delta;
//while _spawnTimer < 0, we have particles to spawn
while(this._spawnTimer <= 0)
{
so every time that a negative delta
is used, it increases the time before the next particle spawns.
When time is reversed weird behaviour is observed by the particles when the age drops below 0. Granted time should never be reversed however since the consumer of the library can manually control the update method it's possible for them to play time backwards. This is merely a safety catch so that when that does happen the particles whom's age shows they haven't been born yet are killed off. This stops the weird behaviour from occurring.
Once time returns to normal (ie. forward) then new particles are created in place of those that were killed during the reversal of time.