The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice. The answers to the quiz can be found in Appendix A, "Quiz Answers."
Quiz
1:
How many axes is a joystick allowed to have in Windows?
2:
Why is it important to calibrate joysticks?
3:
What's the purpose of the Win32 joyGetDevCaps() function?
Exercises
Modify the UFO 2 program so that the thrust button not only causes the flying saucer to appear with thrust, but also so that it acts like it has thrust. In other words, alter its vertical speed in response to the thrust button so that the saucer actually thrusts upward. It might be a good idea to make the thrust button have more of an impact on the saucer's lift than simply pressing up on the joystick; the second exercise will make this feature more important.
Experiment with adding gravity to the UFO 2 program by slightly changing the flying saucer's vertical speed in the GameCycle() function.