Game Development Reference
In-Depth Information
The CheckTransitions() function calls ProcessAIVehicleCommand() to set the next state in the
m_NextState variable that is returned. (See Listing 8-21.)
Listing 8-21. Checking for a State Transition
FSM_StatesTank CheckTransitions()
{
ProcessAIVehicleCommand();
return m_NextState;
}
Creating the Vehicle Steering Class
The Steering class represents the steering controls of a vehicle.
The HorizontalSteeringValues enumeration (see Listing 8-22) holds the values for the horizontal
steering of a vehicle and the values are
None : Indicates that there is no steering value
Right : Tells the vehicle to turn to the right
Left : Tells the vehicle to turn to the left
Listing 8-22. Horizontal Steering
enum HorizontalSteeringValues
{
None,
Right,
Left
}
The VerticalSteeringValues enumeration (see Listing 8-23) holds the values for the vertical steering
of a vehicle. The values are
None : Indicates that there is no vertical steering value
Up : Tells the vehicle to move upward
Down : Tells the vehicle to move downward
Listing 8-23. Vertical Steering Values
enum VerticalSteeringValues
{
None,
Up,
Down
}
 
Search WWH ::




Custom Search