Join Joseph Labrecque for an in-depth discussion in this video Bunny death, part of HTML5 Game Development with Phaser.
…While we are currently decrementing our bunny count upon space rock collision or…friendly fire, we have no real indicator of what just happened.…A user may not understand that a bunny has been lost.…To remedy this,…we'll create a ghost which will speed toward the upper atmosphere post-impact.…To do this,…the first thing we need to do is load in the asset that will represent that.…Moving over to our preloader, directly beneath the explosion inside of…our preload function, we're going to say, this.load.image.…
And here, we'll tag this as ghost, so that we can identify it later.…And this'll point to images/ghost.png.…Popping back over to game.js, we'll now create this makeGhost function.…So, let's go all the way down to, after our friendly fire function.…And this is a lengthy function, so I will paste it in from the code snippets.…And, we can see that makeGhost is a function or…a passing in our particular bunny instance.…
The reason we're doing that is because we need to know the x and…y position of our bunny as well as its scale x.…
Author
Released
8/6/2014- 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
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 4s
-
-
1. Setting Up Phaser
-
Choosing a code editor2m 28s
-
Image assets3m 42s
-
Preparing fonts1m 59s
-
Music and sound effects1m 57s
-
2. Configuring Loaders and States
-
Creating your Phaser project2m 33s
-
Bootloader setup5m 5s
-
Building the preloader6m 18s
-
Building the menu state5m 4s
-
-
3. Populating the World
-
Building the world2m 57s
-
Generating bunnies6m 9s
-
Bunny movement7m 7s
-
Spawning enemies5m 38s
-
-
4. Functionality
-
Particles and emitters5m 32s
-
Handling emitter collisions2m 25s
-
Friendly fire2m 4s
-
Bunny death3m 27s
-
-
5. Wrapping Things Up
-
Detecting game-over2m 1s
-
Adding countdown text2m 39s
-
Adding "Game Over" text5m 13s
-
Adding sound effects5m 49s
-
Preparing for mobile1m 25s
-
-
Conclusion
-
Conclusion49s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Bunny death