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

Make particle animation state optional #6930

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

samme
Copy link
Contributor

@samme samme commented Oct 23, 2024

This change creates Phaser.GameObjects.Particles.Particle#anims only if the particle's emitter has at least one animation.

This should reduce memory usage and make cleanup faster (#6482, #6929) for games using non-animated particles.

It is a breaking change for games adding a first animation to the emitter after some particles have already been created. That will now cause an error. But the usual approach for adding animations will work like before:

this.add.particles(0, 0, 'explosion', {
  anim: ['explode']
  // ...
});

@photonstorm photonstorm merged commit 37a6dc6 into phaserjs:master Nov 13, 2024
@photonstorm
Copy link
Collaborator

👍

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

Successfully merging this pull request may close these issues.

2 participants