Join Joseph Labrecque for an in-depth discussion in this video Friendly fire, part of HTML5 Game Development with Phaser.
- View Offline
…If we can simply spam the explosions, the game isn't very difficult at all.…Let's add an extra element of strategy to our game by allowing the emitter…particles to cause harm to the bunnies as well.…This will require that we ensure, whenever we spawn an explosion, that we do so…far enough away from any of our bunny entities that we do…not cause any unnecessary deaths.…So, inside of Gamejs, once again we'll scroll down to our update function, and…we're going to copy this initial function here, which checks our space rocks…against our emitters, and we'll paste that in below the other two overlap functions.…In this instance we're going to check,…instead of space rock group, our bunny group.…We're going to check that against our emitter, which is named Burst.…And when a collision is detected,…we're going to invoke a new function called friendlyfire.…So, let's create that function right now.…Right underneath checkBunniesLeft.…So friendlyfire as a new function, and…here we'll pass through a reference to the particular bunny that's been hit by…
- Downloading the Phaser framework
- Creating your first Phaser project
- Building the preloader and menu states
- Creating and spawning entities
- Working with particles and emitters
- Detecting and handling collisions
- Detecting "game over"
- Adding sound effects and text
- Preparing for mobile deployment