Workshop


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

  1. 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.

  2. Experiment with adding gravity to the UFO 2 program by slightly changing the flying saucer's vertical speed in the GameCycle() function.



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