Join Lee Brimelow for an in-depth discussion in this video Creating the Background class, part of Building Flash Games with Starling.
- View Offline
So in this chapter we're going to be building our Menu state.…Again, this is the first state that actually you get into when you first launch the game.…It's a menu that has the star background, and it has the logo and the Play button.…What we first need to do is to create a class called Background, and this is…going to hold that stars image and it's actually going to scroll it, so we have…an animated star background.…So I'm going to go to my main source folder, right-click, create a…new ActionScript Class.…
And for the different objects of our game, we're going to put it in a…Package called objects.…And the name of this Class is going to be Background and the Superclass is going…to be starling.display.Sprite.…So now in order to achieve the scrolling effect, we're going to need two copies…of that sky texture that we're going to be scrolling and moving.…So in the constructor here I'm going to create a couple of instance properties,…and I'm going to call it sky1 and that's going to be equal to a new image object…
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