Game Development Reference
In-Depth Information
￿ :Thisissimplyabasicstructure,
consisting of parameters you need to define for the engine to
work. This is more practical than setting values directly on the
engine itself or passing in a horde of parameters to an
initialization function. Doing it in this way also lends itself
better to validation, like we performed on levels in Marble
Runner; however, I don
t implement any validation here.
￿ : The document class for the whole application. There
will be very little here, which is new from previous examples.
￿ :Theclasswrapperforthetitlescreen
as basic as it
￿ : The class wrapper for the rules screen, where I
briefly demonstrate gesture events.
￿ : The heart of the application, which creates and
controls the state machine, routes input information, and
instantiates the engine.
￿ : The wrapper for touch input in the
game since we need it to behave in a specific way to avoid
twitchiness or hiccups.
ll start with the relatively superficial bits of application func-
tionality and then move to the game itself.
As with other examples, the main document class just handles
navigation between sections of the game, which number three in
this application.
public class Main extends MovieClip
static public const FRAME_TITLE:String = " title " ;
static public const FRAME_RULES:String = " rules " ;
static public const FRAME_GAME:String = " game " ;
static private var mInstance:Main;
public function Main()
mInstance = this;
addEventListener( FRAME_TITLE, onFrameTitle,
false, 0, true);
addEventListener( FRAME_RULES, onFrameRules,
false, 0, true);
addEventListener( FRAME_GAME, onFrameGame, false,
0, true);
Search Nedrilad ::

Custom Search