Creating the Background class


show more Creating the Background class provides you with in-depth training on Developer. Taught by Lee Brimelow as part of the Building Flash Games with Starling show less
please wait ...

Creating the Background class

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 ...

Creating the Background class
Video duration: 5m 55s 2h 57m Intermediate

Viewers:

Creating the Background class provides you with in-depth training on Developer. Taught by Lee Brimelow as part of the Building Flash Games with Starling

please wait ...