Oh sorry I missed the part that I needed to press ‘c’. Yes, it worked, thanks. What did you do? It seems like it’s overlaying the phaser3 scene. You are not using “transparent: true” in the config either.
I did nothing really, just took out a bit of jQuery. You should be able to diff it with the original, hardly any changes. The confetti div container is added/removed every time you press ‘c’, so it goes on top (high z-index).
For anyone looking for a falling confetti effect in Phaser3, you can use the particle emitter and rotate and scale the particles. You can do this by adding functions to the scaleX and rotate.properties. Btw you can either choose scaleX or scaleY doesn’t matter, the idea is that it makes the confetti’s look like they’re flipping over and over.
Copy&paste the code below into the Phaser3 Sandbox to see the effect
The only down-side to this code is that the animatioin depends on the monitor refresh rate. Meaning, the particles will flip and rotate faster on a device with a 144hz monitor as compared to a device with a 60hz display.
@samme You are right that fixes the rotate and flip animations very cool code update, thank you. Btw the onEmit function can be removed with the new onUpdate code, because the properties don’t need to be initialised.
But I just noticed something else besides the animation. I can switch my laptop monitor between 144hz and 60hz, and when I run the test code in Phaser3 Sandbox with 144hz there are noticably more particles onscreen when compared to 60hz Must be something with the particle emitter…