Platform SDK: DirectX |
This topic pertains only to application development in C and C++. See DirectInput Visual Basic Samples.
The DIGame sample application is a simple shooting game that can be played with keyboard, mouse, or joystick.
Source: (SDK root)\Samples\Multimedia\DInput\Src\DIGame
Executable: (SDK root)\Samples\Multimedia\DInput\Bin
The default input device is the keyboard. Change the device by choosing Select Input Device from the File menu.
Move the ship up and down with the arrow keys, the mouse, or the joystick. Change directions by moving left or right. Fire by pressing the spacebar, the left mouse button, or the primary button on the joystick.
To start again, select New Game from the File menu.
The input code is all in Digame.cpp.