Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
reececomo opened this issue Mar 27, 2024 · 1 comment
Open

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

reececomo opened this issue Mar 27, 2024 · 1 comment

Comments

@reececomo
Copy link

reececomo commented Mar 27, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant