Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So now that we have our basic game structure created, we need to turn our attention to the assets in which we are going to use in this game. Now if you have access to the exercise files, if you look in that folder, you will see there's a whole bunch of different types of assets ranging from animation sequences, like here, we have this alien animation sequence, we have sound effects, particles, fonts, and we need a way in which to manage those inside of our game project. So what I'm going to do is inside the exercise files, I'm going to copy all of those assets to the clipboard and then go back to my Flash Builder project and I'm going to create a new folder at the root of my project. So I'm going to right-click, create a New > Folder, and I'm going to call this folder assets, and then I'm simply going to paste those assets into that folder so that we have them inside of this assets folder.
Now in our project we are going to create a class that's specific job is to manage our assets for us. So I'm going to go into the core package and create a New > ActionScript Class and I'm going to call it Assets. And this will be used to embed and manage the various assets that we are going to have in our game. Now all of those are going to be static assets, because again, we don't want to instantiate this class and have different versions of all of these assets. So I'm going to modify the constructor where I'm actually going to replace it with a public static function called init and this is going to have a return type of void. We are not going to be returning anything.
Now we are actually going to call this function in our Game class constructor, because again, the first thing that we want to do when our Game class is created is to initialize our assets, so I'm going to say Assets.init. So again, all of our assets are going to be managed from this Assets class and in the next sequence of movies in this chapter, I'll show you how you can incorporate different types of assets and make them available for your game.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 92378 Viewers
82 Video lessons · 104117 Viewers
71 Video lessons · 75523 Viewers
56 Video lessons · 106913 Viewers
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.
Your file was successfully uploaded.