pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
784 stars 124 forks source link

`update(delta)` doesn't respect Ticker speed #213

Open reececomo opened 3 months ago

reececomo commented 3 months ago

Hey there 👋

When autoUpdate = true, we would expect the emitter to respect the speed property of the shared ticker (like other related concepts such as AnimatedSprite). ~It's almost like delta is ignored completely.~ Update: It is!

It's probably due to Emitter.ts#L563?

/**
     * Updates all particles spawned by this emitter and emits new ones.
     * @param delta Time elapsed since the previous frame, in __seconds__.
     */
    public update(delta: number): void
    {
        if (this._autoUpdate)
        {
            delta = ticker.elapsedMS * 0.001;
         // ^ 💥 delta param is discarded
        }

Do you think it might be unexpected that the delta parameter is discarded and the global const ticker's elapsedMS is used instead?

reececomo commented 3 months ago

The laziest version of this could be replacing elapsedMS with deltaMS?