Exercises

Remember that, when tweaking one particular game mode, it saves time to have the Pop program start up in the game mode that you want to play with. The way to control this is to edit the CPopDoc constructor in popdoc.cpp. Do it now, it’ll save you a lot of clicking later on. So make your startup game be cGameAirhockey or, if you’ve taken the trouble to make new files and change the names, cGameBasketball.

Exercise 16.1: Better hitting and other tweaks

It feels a bit cumbersome hitting the puck with the player. It would probably be easier if you make the player smaller. Try using a setRadius call in its constructor to make it smaller. In doing this you reduce the mass of the player (normally equal to the density times the radius cubed), ...

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.