Creating the main game class


show more Creating the main game 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 main game class

So now that we have our main entry to our game created in the Spacer class, we now need to create our Game class, which is going to be our root Starling instance. So what I'm going to do is go into the default package here, right-click, and say New > ActionScript Class. Now we're actually going to be organizing the classes in our games into different packages, and we're going to hold this Game class in a package called core, which is going to contain our core files for our project.

And for Name we're going to give this a name of Game. For the Superclass, this is going to need to sub-class sprite, but again, we're not going to be using flash.display. Sprite, we're using starling.display.Sprite, so that's a very important distinction. It can be a little difficult at first when you first begin with Starling, because again, the class names are often times exactly the same as the traditional display list, so you need to make sure you are using the correct one. I&...

Creating the main game class
Video duration: 4m 13s 2h 57m Intermediate

Viewers:

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

please wait ...