Join Joseph Labrecque for an in-depth discussion in this video Dealing with offscreen entities, part of HTML5 Game Development with Phaser.
- When our space rocks leave the world bounds,…they're gone forever.…We can reuse the individual rocks…as they leave the world bounds…by leveraging certain mechanisms within Phaser…which handle this exact scenario.…So, to do that, let's go into…our build space rocks function inside of game J S.…So, here it is.…We're gonna add a number of different things…within our for loop here.…The first one is going to be an instruction…upon each of these space rocks to check world bounds.…
And we'll set that equal to true.…And what this means is that, once the space rock…has left the stage, left the bounds of the world,…it'll be able to fire off an event,…it'll be aware that it has left the world.…And, there's a small B there and that should be a capital B.…So always make sure of case errors…like that when you're coding.…The next thing we wanna do is bind an event to that.…So we'll do R dot events dot on out of bounds.…
And we'll add that.…And the function we're going to call is called…this dot reset rock.…And we'll pass through this, which, in this particular case,…
- 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.