Game Development Reference
In-Depth Information
Summary
In this chapter, we had a crash course in responding to user input. First we looked
at the differences between DirectInput and XInput. Then we looked at how to detect
and respond to mouse and keyboard input. Next, we moved on to using joysticks with
DirectInput, where we first looked at how to get a list of the available game controllers
that are connected to the computer. Then, for simplicity, we added code to obtain the
first game controller from the list and get some input from it. We wrote test code that
outputs some debug text when you press the 0 , 1 , 2 , or 3 buttons. And finally, we
looked at XInput controllers. The code we implemented to get input from the XInput
controller was very similar to the DirectInput code, but slightly different. And lastly, we
added some code to write some debug text into Visual Studio's Output pane whenev-
er you press the A , B , X , or Y buttons on the XInput controller. In the next chapter, we
will learn how to draw 2D graphics on the screen and create a 2D tile-based game
world.
Search WWH ::




Custom Search