Hour 6. Controlling Games with the Keyboard and Mouse


Hour 6. Controlling Games with the Keyboard and Mouse

All the graphics in the world wouldn't save a game if you couldn't interact with it. There's a name for a game with no user interaction ”it's called a screensaver! User interaction can come from several different places, but you can generally break it down into a short list of user input devices: the keyboard, the mouse, and joysticks. The keyboard and mouse are by far the two most standard user input devices on computers, and are just about guaranteed to be supported on all personal computers. Joysticks are also quite common, but aren't nearly as commonplace as keyboards and mice. So, you should consider the keyboard and mouse the two most important game input devices, with joysticks following behind in third place. This hour focuses on interacting with the user via the keyboard and mouse, whereas Hour 7, "Improving Input with Joysticks," tackles joysticks.

In this hour, you'll learn:

  • Why user input is so important in games

  • How each of the major types of input devices impact games

  • How to efficiently detect and respond to keyboard input

  • How to handle mouse input

  • How to create a program with an animated graphical object that you can control with the keyboard and mouse



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net