Game Development Reference
In-Depth Information
Table 11.1 Common Types of Events ( Continued )
Game Events
Description
Animation and Sound Events
AnimationStarted
An animation has begun.
AnimationLooped
An animation has looped.
AnimationEnded
An animation has ended.
SoundEffectStarted
A new sound effect has started.
SoundEffectLooped
A sound effect has looped back to the
beginning.
SoundEffectEnded
A sound effect has completed.
VideoStarted
A cinematic has started.
VideoEnded
A cinematic has ended.
Distinguishing Events from Processes
If you recall the Process class from Chapter 7,
you
might wonder if there is a significant difference between a game event and a process.
The difference is easy
Controlling the Main Loop,
a game event is something that has happened in the most
recent frame, such as an actor has been destroyed or moved. A process is something
that takes more than one frame to process, such as an animation or monitoring a
sound effect.
These two systems are quite powerful by themselves and can easily create a game of
significant complexity with surprisingly little code in your game logic or view classes.
Events are the main tool used for communicating to other systems. Using the event
system presented in this chapter, you can design complex systems that are nice and
decoupled from each other while still allowing them to talk to one another. This
decoupling allows these systems to grow and change organically without affecting
any of the other systems they are attached to, as long as they still send and respond
to the same events as before. As you can see, events are crucial tools to have in your
programming toolbox.
 
 
Search WWH ::




Custom Search