Winter 2019 CS 32
Programming Assignment 3
Zombie Dash
Part 1 due 11:00 PM Thursday, February 21
Part 2 due 11:00 PM Thursday, February 28
The Project 3 specification document is complete.
Updates:
-
2/26 5:00 pm: Some people are having trouble with the new sample executables.
If you are one of them, here are links to the old versions so you can at
least observe how they behave:
old Windows sample,
old Mac sample,
old Linux sample.
-
2/25 2:50 am: The links to the sample executables below are now to versions
that incorporate the updates mentioned below.
-
2/24 11:55 am: Here are some more clarifications and corrections; they may
disagree with the sample executables for now, but those will be rebuilt
incorporating the corrections and posted this evening:
-
2/21 2:45 pm: Here's a clarification of what StudentWorld::init()
must return; it replaces the second paragraph of p. 15 of the spec:
When the player has finished the level loaded from level01.txt, the next
level data file to load is level02.txt; after level02.txt, level03.txt;
etc. If there is no level data file with the next number, or if the level
just completed is level 99, the init() method must return
GWSTATUS_PLAYER_WON. If the next level file exists but is not in the
proper format for a level data file, the init() method must
return GWSTATUS_LEVEL_ERROR. Otherwise, the init() method
initializes your data structures/objects for the current level and returns
GWSTATUS_CONTINUE_GAME.
To see what the game looks like in action:
-
Windows: Open the Windows sample
executable zip file and drag the folder named ZombieDash in it to
your desktop. In that desktop folder, double-click on the ZombieDash
application. On the SEASnet Windows server, you may have to move the folder
to C:\Users\yourusername instead of the desktop.
-
macOS: You'll need to have XQuartz and freeGLUT installed to run the
program.
-
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
.
-
Install freeGLUT:
-
Install the homebrew package
manager.
-
Open a Terminal window and run the command
brew install freeglut
.
-
Unzip the Mac sample executable zip
file. In that zip file is a file named README.txt that tells you how
to launch the program.
-
Linux: We haven't yet tested the Linux version, but it builds.
-
Install OpenGL and freeGLUT (already installed on the SEASnet Linux
servers cs32.seas.ucla.edu, lnxsrv06.seas.ucla.edu, 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 ZombieDash directory. In that directory
there is a file named README that tells you how to launch the program.
You won't hear any sound effects. We haven't tested the Linux version
beyond ensuring it builds and tries to connect to an X11 server, but it
should work if you set your DISPLAY environment variable correctly, which
we haven't had a chance to try.
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.
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.
At some point in Project 3, you may find the
Stringstreams writeup helpful.
Note for Visual C++ users: If the Windows skeleton doesn't build for you,
you probably need to ensure that your project is using Windows SDK Version
10.0.17763.0. To do this:
-
Launch the Visual Studio Installer, find your version of Visual Studio,
and select Modify. In the list on the right side of optional packages,
make sure SDK 10.0.17763.0 is selected.
-
After modifying your Visual Studio installation, open the project in Visual
Studio and right-click on Solution 'ZombieDash' above the list of source
files. Select Retarget Solution and choose the newly installed version of
the SDK.
-
Build the project.
Notes 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.