CS 32 – Summer 2019 E. Ambrosio
Project 4: TunnelMan (due Friday, August 23rd, at 11:59 PM)
NOTE: The specification, as well as the skeleton and sample files for TunnelMan, and additional supplemental documentation is located on CCLE.
To see what the game looks like in action:
• Windows: Open the sample executable zip file and drag the folder named IceMan in it to your desktop. In that desktop folder, double-click on the IceMan application.
• Mac OS X: You’ll need to have XQuartz and freeGLUT installed to run the program.
o Install XQuartz:
▪ Click the download link, open the downloaded .dmg file, double-
click on XQuartz.pkg, and follow the installation instructions.
▪ Log out and log back in again.
▪ To verify the installation, open a Terminal window and run the
command echo $DISPLAY. That should produce one line of output
that ends with org.macosforge.xquartz:0. o Install freeGLUT. You have two options:
▪ Option 1: Install the MacPorts package manager. Select the appropriate installation links and install the package:
MacPorts-2.4.0-10.12-Sierra.pkg MacPorts-2.4.0-10.11-ElCapitan.pkg MacPorts-2.4.0-10.10-Yosemite.pkg MacPorts-2.4.0-10.9-Mavericks.pkg MacPorts-2.4.0-10.8-MountainLion.pkg
To verify the installation, open a new Terminal window and run the command port version. That should produce the output Version: 2.3.4. In that new Terminal window, run the command sudo port install freeglut, which will prompt you for your password to authorize installation. A lot of output will be produced. To verify the installation, run the command port installed freeglut.
When some people run sudo port install freeglut, the response is Error: Port freeglut not found and the installation fails. That’s probably because you are behind the a firewall. Bypassing the firewall (perhaps by creating a hotspot with your phone) may do the trick. You might also need to run sudo port selfupdate, but that step is probably not necessary.
CS 32 – Summer 2019 E. Ambrosio
▪ Option 2: Install the homebrew package manager. Then run the command brew install homebrew/x11/freeglut.
• Unzip the sample executable zip file. In that zip file is a file named README.txt that tells you how to launch the program.
• Linux:
o Install OpenGL and freeGLUT (already installed on the SEASnet Linux
servers lnxsrv07.seas.ucla.edu and lnxsrv09.seas.ucla.edu):
Ubuntu: sudo apt-get install freeglut3 freeglut3-dev Fedora: sudo yum install freeglut freeglut-devel
Unzip the sample executable zip. Change into the TunnelMan directory and run the command ./TunnelMan. You won’t hear any sound effects.
Use the arrow keys (or 8426 or wasd) to move and dig, the space bar to squirt, and the tab key to drop a gold nugget. You can hit Escape to sacrifice a life and restart the current level. You can type q to quit the game prematurely. Hitting the f key freezes the action; hitting any key after that takes one action step, except that hitting the r key resumes regular play. (This is not intended for normal game play, but is useful for testing.)
You can also download the project skeletons with the code we’ve written, for Windows, Mac, or Linux and make sure you can build and run them. All they’ll do is have you lose a life each time you hit Enter, but at least you can verify that the graphics library works. [NOTE for Xcode users: You might get a message at startup relating to the Assets directory. If you want to fix the issue just for this project, select File / Project Settings… and for Derived Data Location, select Project-relative Location. If instead you want to fix it for every project you create with Xcode, select Xcode / Preferences… and for the Derived Data, select Relative.]
The only files you will modify are Actor.h, Actor.cpp, StudentWorld.h, and StudentWorld.cpp. Indeed, those will be the only code files you’ll turn in, so in
implementing your solution, you must not depend on any changes you make to code files other than those four.
Supplemental Documentation
Professor Carey Nachenberg from UCLA has provided some object-oriented programming tips.
At some point in Project 4, you may find the Stringstreams writeup helpful.