Join Joseph Labrecque for an in-depth discussion in this video Generating bunnies, part of HTML5 Game Development with Phaser.
…Now that we've created our game world,…we need to populate it with friendly creatures.…We'll use the phase and group mechanism to generate and help manage these entities.…With entities created as part of a group,…we can access them both individually and upon a group level.…So the first thing we'll do is go into our preloader,…because we need to load in one of our spreadsheets.…So inside the preload function, we'll say this.load.atlasXML.…And here we need to give this an identifier that we can invoke later on,…and we'll simply call it bunny, since that's what it represents.…
And then two additional things we need to place in here is a reference to the actual…spreadsheet PNG file, followed by a reference to the spritesheet data file.…So to do that, we put images/spritesheets/bunny.png.…And then for the data file, it's in the same location.…Except it's an XML file instead of a PNG file.…So we do images/spritesheets/bunny.xml.…
All right.…Popping back over to our game state.…We're going to add a couple of variables up here.…
- 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