Game Development Reference
In-Depth Information
Chapter 3. Adding the Input
We have images on the screen, and we can see the start of a game forming, but
it wouldn't be much of a game without some interactivity. The keyboard and mouse,
gamepad, touch screen, or motion control—if you've played a video game then you
have used one of these to tell the game what you want it to do. We need a way to
play the game, and in this chapter we'll look at some of the different options that are
available to get that input into the game, and add some interactivity.
Over the course of this chapter you'll learn how to add input to your game, and we'll
take this further by explaining and understanding the different types of input, as well
as how to use the different input devices in Windows 8.
You'll understand the following later in the chapter:
• Types of input
• The Pointer API
• Keyboard input
• XInput for the Microsoft Xbox 360 Controller
Input devices
There are four standard input devices you will encounter in your travels through the
Windows game development journey. They are as follows:
• Keyboard
• Mouse
• GamePad
• Touch screen
The keyboard and mouse have traditionally been the staple of PC gaming, and con-
tinue to remain in that position for anyone with a desktop or laptop. The sheer num-
ber of options available on a keyboard combined with the precise analog input from
a mouse allow for a large variety of games. Most gamers will stick to using a small
selection of the available keys on the keyboard, depending on the type of game, so
ensure that you consider the usability of any control scheme you create, and don't get
carried away adding buttons just because the keyboard has plenty!
Search WWH ::




Custom Search