Microsoft DirectX 8.1 (Visual Basic) |
The first step toward creating an action map is the definition of the game actions. These actions are specific to the application and are defined by the developer. In the case of the ActionMapper Sample, the actions chosen reflect its needs as a space combat simulator. These values can be defined in many ways as the developer sees fit. They could be defined as an enumeration, as in the Preparing the Action Map overview, or they could be defined as constants, as in the following code fragment from the ActionMapper sample.
Const INPUT_LEFTRIGHT_AXIS = 1 Const INPUT_UPDOWN_AXIS = 2 Const INPUT_TURNLEFT = 4 Const INPUT_TURNRIGHT = 5 Const INPUT_FORWARDTHRUST = 6 Const INPUT_REVERSETHRUST = 7 Const INPUT_FIREWEAPONS = 8 Const INPUT_ENABLESHIELD = 9 Const INPUT_DISPLAYGAMEMENU = 10 Const INPUT_QUITGAME = 11
Once these values are defined, they can be assigned to genre-specific action-mapping constants. This is shown in Step 2: Defining the Action Map.