Join Lee Brimelow for an in-depth discussion in this video Firing bullets with the mouse, part of Building Flash Games with Starling.
- View Offline
So in the last movie we started to fill out our BulletManager functions here for…updating and for firing, but we only want to fire bullets when the user has…their mouse down, so when they actually have the mouse button down.…So let's set that up in the play state.…So the first thing I'm going to want to create is a new instance of the…BulletManager class.…I'm going to come under where we created our hero and I'm going to create a…variable called BulletManager.…It's going to be of type new BulletManager.…
Now remember to that we need to pass in a reference to our play state here.…So I'm just going to pass in this.…Again, let's create bulletManager as an instance variable.…So now what we want to do is to create a Boolean value.…We're going to create a public Boolean property here, public var, and we're…going to call it fire.…This is going to be able to tell the BulletManager whether it should fire a bullet or not.…Now we're going to set it at the default to false up here, because when we first…
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