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:

What is the purpose of the vector class in the Standard Template Library?

2:

What is the purpose of the SA_KILL sprite action?

3:

What is double buffering, and why is it important?

Exercises

  1. Modify the SpriteCollision() function in the Fore 2 example program so that the velocities of the sprites are not only swapped, but also increased slightly with each collision. Then run the program and notice how the balls speed up with each new collision.

  2. Create a couple of new sprites in the Fore 2 program example that use an image other than the golf ball image. Pay close attention to how you set the Z-order of the new sprites, and then watch as they move with respect to the golf ball sprites. You should quickly be able to tell how useful Z-order can be in providing depth to games .



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