Game Development Reference
In-Depth Information
btnPostScore.mouseEnabled = false;
btnPostScore.alpha = .5;
}
private function onContinue(e:MouseEvent):void
{
dispatchEvent(new DataEvent(MarbleRunner.EVENT_
NAVIGATE, true, false, MarbleRunner.FRAME_GAME));
}
private function onQuit(e:MouseEvent):void
{
dispatchEvent(new DataEvent(MarbleRunner.EVENT_
NAVIGATE, true, false, MarbleRunner.FRAME_TITLE));
}
}
This screen uses an input TextField that allows a player to enter
his or her initials and submit them to the database. When the
player selects this input box, the iPhone
s virtual keyboard will
appear for them to type. Once they click Post Score, the saveScore
method of the Leaderboard class is called, which we dissected ear-
lier. To keep a player from submitting the score repeatedly, we dis-
able the button after it has been tapped once.
'
Design Considerations
Now that we
ve taken an in-depth look at all of the codes behind
Marble Runner, let
'
s take a moment to consider the elements of
game design that come into play in this example.
'
Level Design
If you open one of the Level clips inside the library, you
ll see that
it is composed of a bunch of wall Sprites and some positioning
clips.Bybuildingtheengineandlevelclassestousethisframe-
work, any developer could open this file and build new levels for
the game without having to touch any code, assuming they used
only the existing assets. This is an extremely important and inten-
tional decision to make when architecting a game engine. If you
'
'
re
a solo developer, you will have built yourself a powerful toolset for
making level design less tedious. If you are part of a team, some-
one else (maybe not even a developer) can be responsible for lay-
ing out levels and testing them without modifying the code base.
This is actually similar to how larger scale commercial games are
produced.
Search Nedrilad ::




Custom Search