Game Development Reference
In-Depth Information
have just saved yourself the repetitive work of creating the states, implementing
the input handling logic and collision detection. We discuss these benefits in the
last section of this article.
19.1.2 Entities
Entities in Eberos GML2D are akin to actors in a game. The same way that actors
are the meat of all games, entities are the meat of Eberos GML2D. Entities are used
to model the actors in a game. There are two kinds of entities in Eberos GML2D:
user-defined entities and specific entities. While specific entities are entities that
abstract a specific concept such as a game message, user-defined entities allow
the language user to create new kinds of entities not specified in the language by
combining other Eberos GML2D constructs.
GameRoot . The GameRoot represents the entry into the game; this is similar to the
main function in a C++ program. In Eberos GML2D, the game model is viewed as
a graph, where at least one of the entity edges must be connected to the GameRoot .
The GameRoot is also used to specify an initial setup of the game. Currently, the
GameRoot entity specifies the screen resolution and whether the game is windowed
or full screen.
GameMessageTracker . The GameMessageTracker entity controls all the possible
GameMessages that exist in the model. This entity ensures that any message by
any of the other entities is a valid message. Game messages in Eberos GML2D
are represented by the GameMessage entity. Just like in any game, messages in our
language represent a single, specific piece of data.
GameMusicManager . Similar to the GameMessageTracker ,the GameMusicManager
entity specifies the music and sound effects available in the game model. The
GameMusicManager also controls which sounds and music can be played by the
PredefinedActurators . This entity is populated by SFXTrack and BGMTrack en-
tities, which specify information specific to the audio file. The Track ID is a unique
identifier that allows for each specific track to be used by the PredefinedActuators ,
while the Track URL is used to specify the location of the music and sound effects
in the system. The Track URL is used when translating the Eberos GML2D model
into source code to transfer the file to the project's folder. This is done as a means
for reducing the errors of specifying the project's path to each sound file.
UserDefinedEntity . UserDefinedEntities are meant as the catch-all of entities,
andcanbeusedtomodelanyofthespecificentities(see Figure19.3 ) .Entitiesare
the center of Eberos GML2D; everything is treated as an entity in the game model.
Since entities/actors can range from menus to dialog choices to players and much
more, entities must support a range of properties common to all of these actors.
UserDefinedEntities can be composed of zero or more entities, which allows for
Search WWH ::




Custom Search