Particle Explosions
- medium
- Game Development
Phaser offers a particle system that allows you to spawn dozens (or even hundreds) of all sprites and have them burst out from a given point. You should use a Phaser emitter to spawn an explosion effect whenever an asteroid dies.
Task Definition
Whenever an asteroid is destroyed, emit a burst of particles.
Hints
You will need to find a particle image on the internet to use when an explosion occurs. Search Google for “Explosion Particle” to find a small (16x16 - 32x32 pixel) image that you can spawn 10-20 of when an explosion occurs.
A good example of how to use the Phaser Particle System is shown on this page; Phaser Click Burst Example.
Extensions
- If you have previously given asteroids health from another bonus quest - you could also decide to spawn a small explosion of sparks when a bullet hits an asteroid but doesn’t destroy it to give the player some feedack. Make sure it’s a lot smaller than your main explosion though!
While it’s all well and good being able to fire laser beams, true heroes need access to more than one weapon to save the universe! This quest will see you reinforcing some of the lessons you have learned throughout the initial steps while also making the game more fun for players.