From the course: Building Flash Games with Starling

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating the main game class

Creating the main game class

From the course: Building Flash Games with Starling

Start my 1-month free trial

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'm going to click Finish…

Contents