Join Joseph Labrecque for an in-depth discussion in this video Friendly fire, part of HTML5 Game Development with Phaser.
…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
Skill Level Beginner
1. Setting Up Phaser
2. Configuring Loaders and States
3. Populating the World
5. Wrapping Things Up
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.