Game Development Reference
In-Depth Information
Chapter 14 examples folder. We
'
ll see how these classes are
implemented.
Once you open the FLA file (and any of the other asset FLAs, for
that matter), you
ll notice one thing right off the bat: there is nothing
on the Stage. All of these assets are being exported directly from the
library with linkages. If you right-click on the Player Sprite in the
library and select properties, then you
'
ll see a dialog like Fig. 14.3 .
This Player Sprite is nothing more than a green square, and it
uses the Player class file in the example package as its base class
from which it derives a new class, simply called
'
(with no
package association). The reason for this structure is so the level
XML does not have to directly associate itself with a particular
package implementation. If you open any of the other asset files
Player
environment.fla, for example
ll see that each asset is set up in
a similar fashion. Figure 14.4 reflects this.
Once each of these individual SWFs is compiled, they can be
loaded into the engine and have all their class definitions recog-
nized. Running the main PlatformerExample SWF should look like
Fig. 14.5 . Doesn
you
'
'
t it bring back that classic NES nostalgia?
Figure 14.3 For each asset, the base class points to the actual code
implementation, and the class field points to a unique, unpackaged name that
Search Nedrilad ::




Custom Search