Sunteți pe pagina 1din 3

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:
• When a dumb zombie drops a vaccine goodie, it does not simply drop it at its own (x,y)
coordinates, but tries to fling it away instead: It chooses a random direction, computes
the coordinates SPRITE_WIDTH units away if the direction is left or right or
SPRITE_HEIGHT units away if it is up or down, and if no other object in the game
would overlap with an object created at those coordinates, introduces a new vaccine
goodie at those coordinates; otherwise, it does not introduce a vaccine object.
• When a level is finished, SOUND_LEVEL_FINISHED should be played; the sample
executables incorrectly play SOUND_CITIZEN_SAVED.
• You must play a SOUND_CITIZEN_INFECTED sound any time a citizen is
successfully infected by zombie vomit. Note that this sound is played only when the
citizen is first covered in vomit, NOT upon subsequent hit by vomit and NOT when they
become a zombie; the sample executables currently don't play this sound. Note also that
in general a new sound cuts off an old sound, so you might not hear
SOUND_CITIZEN_INFECTED being played if its start is quickly followed by a
zombie vomiting.
• Vomit is not blocked by an exit.
• When a landmine explodes, the flames it creates should have a direction of up.
• The status line must be formatted like this (the spec and sample executables are
inconsistent):
Score: 004500 Level: 27 Lives: 3 Vaccines: 2 Flames: 16 Mines: 1
Infected: 0

• 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.
1. Install XQuartz:
a. Click the download link, open the downloaded .dmg file, double-click on
XQuartz.pkg, and follow the installation instructions.
b. Log out and log back in again.
c. 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.
2. Install freeGLUT:
a. Install the homebrew package manager.
b. Open a Terminal window and run the command brew install freeglut.
3. 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.
1. 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):
a. Ubuntu: sudo apt-get install freeglut3 freeglut3-dev
b. Fedora: sudo yum install freeglut freeglut-devel
2. 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:
1. 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.
2. 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.
3. 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.

S-ar putea să vă placă și