Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Join Lee Brimelow in this project-style course that teaches how to build a Flash-based game with Flash Builder 4.6, Flash Player 11, and the Starling framework. Starling, a pure ActionScript 3.0 library for advanced graphics, extends Flash Player 11's support for the modern GPU (graphic processing unit) to enable visual presentations and games in the browser or as a mobile app.
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.
So we are going to be separating our game into different states and more specifically our game is going to have three distinct states. First, it's going to have a Menu state, and this is when you first come into the game it's going to display the logo and a button in which you can start playing the game. Then there's going to be a Play state and this is when you are actually playing the game. And then finally a Game Over state, which will display a message saying, game over and do you want to try and play again. Now a larger scale game of course, you're going to have lots and lots of different possible states.
So to create these state classes what we are first going to do is to create an interface, and an interface is essentially going to require that any state implement a certain set of methods. So I'm going to go to the source folder, right-click and say New > ActionScript Interface, and we are actually going to put this into a package called interfaces. This is the only one we are going to be creating for this game, but still again, it's nice to separate things and organize it into packages. So using the best practices naming conventions, we're going to call it IState, so it's essentially called IState.
I'm going to click Finish. And for our state classes we are going to require that they implement two methods, one is called update and one is called destroy. The update method is going to be called on every frame and that's essentially where we are going to able to update its visuals and do things, different logic operations depending on what state we are in. And then the destroy method is going to handle actually cleaning up after itself, getting rid of the state from memory, so that we don't have memory leaks.
So I'm going to define two functions in here, the first one is called update and the return type of both of these functions is just going to be void, since we are not going to be returning anything from either function. So function destroy(), and again this is going to be of type void for the return type. So that's all we are going to be creating for our interface but now when we create those state classes, when we implement this interface, we'll be sure that each of those states implements the required methods.
There are currently no FAQs about Building Flash Games with Starling.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.