December 2015
Beginner to intermediate
522 pages
11h 21m
English
In order to make our entities emit sounds, some preparations have to be made. For now, we're only going to concern ourselves with simply adding the sound of footsteps whenever a character walks. Doing so requires a slight modification of the EntityMessage enumeration in EntityMessages.h:
enum class EntityMessage{
Move, Is_Moving, Frame_Change, State_Changed, Direction_Changed,
Switch_State, Attack_Action, Dead
};The highlighted bits are what we're going to be focusing on. Frame_Change is a new type of message that's been added in this chapter, and Direction_Changed will be used to manipulate the sound listener's direction. In order to detect when a frame changes during the animation process, however, we're going to need ...
Read now
Unlock full access