Exercises

Exercise 12.1: Spaceship listener with friction

Note that a player with the cListenerSpaceship is still able to feel forces such as gravity. Try giving the player friction in the Spacewar game and see if this makes it more pleasant to use the spaceship keys.

Exercise 12.2: Move the world or move the viewer?

Test out the effects of Ctrl+Arrow and Ctrl+Shift+Arrow in some 2D and 3D views. The visual effect of these keys is that you are moving the world. Now open the listener.cpp file and find the line #define MOVEVIEW 1. Read the comment on this line and change the line to #define MOVEVIEW -1. Now test the same Arrow keys in some 2D and 3D views. The visual effect of the keys is now to move the (invisible) viewer rather than the world. ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.