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 in the last two movies we created our Bullet class and our BulletManager class which helps to keep track of all those bullets. Well we are going to do a very similar thing for our alien. We are first going to create an Alien class and then an AlienManager class. So I'm going to go to my Objects package, right-click, and say New > ActionScript Class and I'm going to call it Alien. Now for a Superclass, we don't want Sprite, we want MovieClip now, because again this actually contains an animation within itself and make sure you choose Starling.display.MovieClip.
Now you'll see that it expects two arguments to the constructor. First is a Vector of Texture objects, which we are going to get out of our Texture Atlas, and then a frames per second so this can actually have an independent frame rate different from the frame rate of our main game. So I'm going to remove these arguments from the constructor and we are going to send them into the super constructor. So first we need to get those textures out of our Texture Atlas. So I'm going to say Assets, and make sure we import that, .ta.getTextures.
We've been using getTexture when you need to get a single one. If you need to get multiple, you use getTextures and then we pass in our root name which is alien, and if you forgot what that name is, you can always look at the Texture Atlas XML file. Then we are going to pass in 12 for the frame rate. Now much like our other objects, we want to set the pivot point of this movie clip directly in the center. So I'm going to set pivotX = width * 0.5 and then we are going to do the same thing for pivotY and this will be height * 0.5 like that.
So that's all we need to do for the alien. Again, similar to the bullet. The difference is that it's not just a static sprite that we are creating here, this is an animated object and that's why we use MovieClip instead of Sprite.
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.