Game Development Reference
In-Depth Information
are a set of
Predefined/CompositeActuators
to be executed when this condition
becomes valid.
The follwoing is a list of conditions found during the development of Eberos
GML2D.
Check Collision
. Is set as true if a collision has happened between the
entities.
Check Position
. Check if the entity position is at or around the specified
position.
Finally, entities can also have zero or one
State/GlobalState
representing the
initial state of the entity's state machine (see Section 19.1.3), zero or one
Sprite2D
(see Section 19.1.4), zero or one
BoundingObject
for collision detection (see Sec-
tion 19.1.5), and zero or one
InputHandler
for modeling input (see Section 19.1.6)
.
19.1.3 Logic
The game logic is probably one of the most important and most time-consuming
aspects of any game project. While there are many approaches to implementing the
behavior of actors in a game, finite state machines (FSM) seem to be one of the more
versatile approaches available. In Eberos GML2D, we have two constructs,
State
and
GlobalState
. These constructs were modeled based on the state architecture
presented by Mat Buckland in [Buckland 05]. Similar to his approach,
States
and
GlobalStates
haveoneownerentity(see
Figure19.4
)
.
State/GlobalState
.
A
State/GlobalState
directly attached to an entity in the
model means that such a state is the initial state for that FSM. Each state is com-
posed of
Actuator_Calls
, which represents actions that entities can take in the
game. These
Actuator_Calls
can be placed inside the
OnEnter
,
OnExit
,
OnUpdate
Figure 19.4.
Basic class diagram for entity to state relationship.