Join Lee Brimelow for an in-depth discussion in this video Implementing the destroy method, part of Building Flash Games with Starling.
- View Offline
So now we have our basic game play completed. So we have our collisions…happening and we determined when we're going to go to the GameOver state.…But now we need to clean up after ourselves in the play state.…So we need to implement the destroy methods.…So first, let's go to our BulletManager.…So in our Manager classes, we need to do a couple of things in the destroy method.…First, we're going to destroy the pool.…So to do that, we're going to call the destroy method of the pool.…Then we're going to set pool = null and we're also going to set our array to null.…
So our array here is called bullets, and we'll set it equal to null.…When it comes to cleaning up after yourself and garbage collection in Flash,…it's better to do too much than not enough.…So it's somewhat of a mystery sometimes about how to force things to be…reclaimed in memory, so it's better just to go overboard and just be sure that…you're cleaning up after yourself.…So we're going to copy this because we're going to do a similar thing in…
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