Comp151 Final Project
Due: Dec 17th at 11:59pm (this is pretty late so late submissions will
end at 7am the following morning - really just overnight if you didn't get
it in on time, not extra time)
Summary:
to end the semester and to give you a taste of larger projects that you
should be ready for now, we will do one final project that is larger than
the rest (and will have a larger number of points commiserate with the
effort required.
Details:
History: Once upon a time 30-some years ago there was a cutting
edge game called
Berzerk by a then popular company: Atari. If you missed the recent
'retro-gaming' craze and don't know the game you can see A
short history of the game(youtube) and you can play through a (slow
and laggy) recreation at retrogames.cz
Your Job: you will build a one level simplified Berzerk clone
according to the specifications below. To make this simple version
implement the specifications below. We'll do a turn based approach rather
than real time for simplicity.
Specifications:
- use a grid (a list of lists) of invisible 'squares'. lets make it 15
squares high and 20 squares wide. (with 72x72 images this will be
1440x1080 pixels which most of your machines should handle fine)
- build a simple level from the original game
- add a player in a random square that isn't occupied by a wall.
- Add 4+ 2*level 'bad guys' to the game board, randomly distributed to
empty squares. (so 6 bad guys for those of you not doing the extra
credit)
- move the player with up/down/left/right keys (feel free to also
include wasd or any other extra combos)
- move the player one square in the direction selected by the arrow
keys.
- the player has 2 extra 'lives'
- give a visual indication that the player has the lives (either
through icons or text)
- When the player hits the space bar, a shot fires in the direction of
the player's last movement.
- If the player wishes to skip a turn (and let the shots and bad guys
continue to move do so with the enter (return on Mac) key.
- If the player hits a wall during movement, the player loses a life
- if the player hits a bad guy, the player loses a life
- if the player collides with a bad guy shot the player loses a life.
- when the player loses a life:
- give a visual indication to the player,
- reduce the player's lives by one
- if the player has no more lives tell the player that they lose the
game
- if the player has another life, reduce the lives by one
- When ever the player does anything (move, shoot or skip through the
enter key)
- move any player shots on the board
- move
any badguy shots on the board.
- there
should be a 30% chance for a bad guy to shoot.
- if
the bad guys shoot, choose one badguy at random and have that
bad guy shoot in the closest horizontal/vertical direction of
the player (if the player is purely diagonal from the
selected bad guy, then choose one.)
- Each bad guy has a 50% chance to move toward the player by one step
either horizontal or vertical (which ever distance is largest)
- if a bad guy runs into a wall, it dies.
- if a player shot hits (is in the same square as) a bad guy, then the
bad guy dies,
- Whenever a bad guy dies, the player score increases by 10.
- display the score in some way.
- if all of the bad guys are dead and the player leaves the map through
the opening then display a "you win" message.
- If two shots occupy the same square (usually because a bad guy shot
and player shot hit each other) then both disappear.
Extra Credit:
There is extra credit available on this project for those students who
have the above base project implemented already.
As a reference, I expect the base project to be worth 240 to 250 pts.
(and the first project was worth around 70 pts)
- For 30 points of extra credit, add sounds (I recommend looking at
pyglet to do the sounds)
- add a sound when the bad guy fires
- add a sound when the player fires
- add a sound when the player loses a life
- add a sound when the bad guy is killed and removed from the game
- add a sound when the player loses
- add a sound when the player wins
- For 40 points add a second level
- use any of the other level maps from the original game
- be sure to adjust the number of bad guys as per the formula above.
- For 20 points
- if the user leaves the current level map before clearing all of the
bad guys, wrap the player around (eg: if the player leaves from the
top of the screen above, then player shows up again at the bottom
before the player clears all the bad guys.
Restrictions and non-code directions:
- you must break your code into functions. No function can be more than
10-15 lines unless you make a really good case for it in your comments
that you are doing one thing (maybe hand crafting the map might need a
function longer, but the rest should be 15 lines or less)
- Comment your code, include your name at the top of the file and at
least one comment per function with at least documentation comments
explaining the parameters and return value of the functions.
- Include a readme with directions for your program (user directions,
how do I do different things)
- include in the readme, anything left undone in the project.
- include in the readme if you did any of the extra credit, which ones
did you do?
- put all of your assets (pictures, sounds etc) into a subfolder - not
in the main project folder with the code
Submission:
zip the entire project folder including the code and the assets subfolder
and the readme.txt and submit the entire thing in one zip file on
blackboard.