Game Development Reference
In-Depth Information
static public function getInstance():Main
{
return mInstance;
}
private function onFrameTitle( _evt:Event ):void
{
Multitouch.inputMode = MultitouchInputMode.NONE;
}
private function onFrameRules( _evt:Event ):void
{
Multitouch.inputMode = MultitouchInputMode.GESTURE;
}
private function onFrameGame( _evt:Event ):void
{
Multitouch.inputMode = MultitouchInputMode.
TOUCH_POINT;
}
private function dispatchFrameEvent():void
{
dispatchEvent(new Event(currentLabel));
}
private function enumerateFrameLabels():void
{
for each (var label:FrameLabel in currentLabels)
{
addFrameScript(label.frame-1,
dispatchFrameEvent);
}
}
}
The most notable element of this class is that each of the three
different application states uses a different form of multitouch
input. The title screen will use mouse events, the rules screen will
rely on gestures, and the game itself will use raw touch point data.
There
s also a static pointer (through getInstance )totheclassso
that sections can easily navigate to other sections.
'
Title.as
On the heels of such a simple document class, an even simpler title
screen component can be obtained. Note that it uses standard
Search Nedrilad ::




Custom Search