Game Development Reference
In-Depth Information
[source]
[projects]
[notanks]
[flexSDK]
[bin]
[obj]
[lib]
[src]
[com]
[efg]
[games]
[notanks]
You now have the basic structure to start creating projects inside the framework. We are now
going to discuss a few topics concerning the structure of the framework classes and then move
into building the reusable framework code.
For Flex Builder, Flash Builder, or another IDE, please refer to the documentation provided for
that product to create a new project and set the default compile class.
Here's a note on the Flash Develop and Flash IDE workflow: A common method of Flash
development is to use the Flash IDE for assets and organization and Flash Develop for code
editing. If this is your workflow of choice, you will want to follow the Flash IDE folder and package
structure rather than the Flex SDK folder structure.
Describing our tile sheet in XML
Before we get to the ActionScript necessary to read our level1 tile map, we need a way to
describe tile types that exist in our tile sheet to the game engine. One method that I have used in
the past is to create a separate XML file to describe the type of tile that exists in each spot on the
sheet. We will do this in an ActionScript class that our game can use.
Creating the TilesheetDataXML.as class
This class will simply be a set of XML data set as a static class variable. This type of construct is
useful for encapsulating data into a class that you will not need to instantiate but contains data we
will want to use in our game.
Here's the structure for the Flash IDE:
/source/projects/notanks/flashIDE/com/efg/games/notanks/TilesheetDataXML.as
And this is for the Flex SDK (using Flash Develop):
/source/projects/notanks/flexSDK/src/com/efg/games/notanks/TilesheetDataXML.as
Here is entire code listing for this class:
/**
* ...
* @author Jeff Fulton
* @version 0.1
* //file name TilesheetDataXML.as
*/
Search WWH ::




Custom Search