Join Lee Brimelow for an in-depth discussion in this video Creating the ExplosionManager class, part of Building Flash Games with Starling.
- View Offline
So now that we've created our explosion particle class here, we're going to…create an ExplosionManager to help track these in our game.…So I'm going to right-click on the managers package, New > ActionScript Class, and…this is going to be ExplosionManager, and click Finish.…Now much like the other managers, we're going to send in our play state to…the constructor, and I'm going to set that as an instance variable, this.play = play.…
Okay, so much like the AlienManager and the BulletManager, we're going to use…an object pool here to hold our particle effects.…These are the things that you don't want to be instantiating in the middle of your gameplay.…So I'm going to create a variable called pool, and that's going to be equal…to new StarlingPool.…and for the type it's going to be a type of Explosion, make sure we import that.…And we're going to create 15 of them, and again that's a number that you're…going to have to trial and error depending on your game for the least number…that you can get away with.…
Starting with installation and configuration of Starling and creation of a Flash Builder project, the course shows how to prepare and import graphical assets, create MovieClip classes from sprite sheets, manage various gaming objects, detect collisions, and add both particle and sound effects. The finished game can be deployed to any browser or mobile device that integrates Flash Player 11, which was released in September 2011.
- Downloading and installing Starling and Flash Builder
- Creating the project
- Creating the main game class, static assets class, and other classes
- Building the state machine
- Creating a static assets class
- Adding images
- Creating sprite sheets with Texture Packer
- Creating and importing bitmap fonts
- Detecting collisions
- Adding particle effects
- Adding sound effects