In the course directory there
is a partial source code program that provides that starting positions for all
the characters in the array. You MUST use this partial program as the starting
point for your assignment. The goal of the game is to bring Homer from Alaska
(top left portion of the array) back to the town of Springfield (near the bottom
right). However if Homer takes too long to travel out of Alaska he freezes and
the player loses the game. Also if Homer moves into the water he drowns and the
game is lost. Finally the tireless agents of the EPA will try to capture Homer
and if they do once again the game is lost. The game will be run on a
turn-by-turn basis. A turn elapses when Homer moves (direction 2, 4, 6, 8) stays
on the same square (direction 5) or toggles the debugging mode on or off
(negative value for the direction). A turn won't pass if the player enters an
erroneous value for the movement direction (10 or larger). After Homer moves the
EPA agents will move in the fashion described in Point #14 below.
The game continues until: 1) The player has lost the game (Homer drowns, freezes
or is captured) [Multimedia visualization of the losing the
game] 2) The player
has won the game [Multimedia visualization of wining the game] 3) The player
has quit the game. [Multimedia visualization of Homer
quitting]
Features to be
implemented |
|
- Display an introduction each time that the game is run which
provides instructions for playing the game.
|
|
- Display a conclusion each time that the game ends. The
conclusion must show the player's game status (won, quit, or if lost
how the player lost the game).
|
|
- Displays a menu that shows the allowable directions that Homer
can be moved which are mapped to the keypad on the keyboard. The
menu should show the 4 cardinal compass points (N = 8, W = 4, E = 6,
S = 2). It should be indicated in the menu that selecting 0 will
allow the player to quit the game.
|
|
- Homer can be moved in the four cardinal compass directions (to
get credit for Point #3 your program merely has to display
the menu whereas to get credit for this point your program has
implemented the part of the menu that makes Homer move).
|
|
- If the player tries to move Homer in one of the inter-cardinal
compass directions (NW, NE, SW, SE) an appropriate error message will
be displayed and Homer will not move.
|
|
- If the player tries to enter a value larger than 9 for the
movement direction another error message will be provided. (Reminder:
Time in the game will not elapse in this case - a turn will not
pass and the EPA agents will not move - if Feature #14 was
implemented).
|
|
- Entering zero for the direction of movement will allow the player
to quit the game.
|
|
- Entering a negative number for the direction of movement will
toggle debugging messages on and off by using the 'debugOn'
flag. The exact content of these debugging messages (e.g., showing module
calls, showing the contents of variables at different points in your
program) are left to your discretion
but as the name implies they should be used to help you debug your
program. (Note: the use of this debugging flag as a global variable is
probably the sole exception to avoiding the use of global variables
for your assignments for this semester). If you find that seeing all
debugging messages appearing all at once through a single debugging
flag is too overwhelming you can implement multiple debugging flags
(e.g., 'displayModuleCalls', 'displayVariableContents')
each of which will each only display a particular category of
debugging message. (For example if
displayModuleCalls was set to 'true' and
displayVariableContents was set to
'false', the game would show a message each time that a function or
procedure was called but it would not display the contents of
variables). If your game has multiple types of debugging messages then
entering a negative number will shown a debugging menu which then
allows the player to select the specific debugging message to turn on
and off. (JT's hint: you should implement this feature early on so
you can actually use it to help you debug your program because this is
a complex assignment! You shouldn't implement it at the end merely to
fulfill the assignment requirements when it's too late to help you fix
the errors in your game because that defeats the whole purpose of
writing a debugging tool).
|
|
- The game prevents Homer from entering an occupied square (contains
a building or an EPA agent).
|
|
- If Homer enters the water, he drowns and the game ends (with an
appropriate consolation message for the player).
|
|
- The game adds to an unfocused, easily distracted side to Homer's
personality (which is pretty much an actual personality trait of the
character Homer Simpson in the movie). Each turn that the player tries
to move Homer (direction 2, 4, 6, 8) there is a 25% chance that Homer
finds something more interesting at his current location. To get
credit for this feature your program should indicate to the player
that Homer has become distracted this turn and refuses to move (e.g., "Homer becomes
distracted and refuses to move) but it doesn't have to be as elaborate
as the sample executable (a random message is displayed). [Multi-media
visualization of this event]
|
|
- The game tracks the amount of time that Homer spends in Alaska (top
six rows of the array - start counting at the row that consists
entirely of water). Homer can only
remain in this area for 10 turns before he freezes. To get
credit for this feature, each time that the game shows the array it
also displays how long he has been in
Alaska and how much time he has left. There is a simple and an enhanced version
of this feature (you can only get
credit for one version). With either version when his time runs out Homer freezes and the
game ends (with a suitable consolation message being displayed).
|
|
|
- Simple version: If Homer spends a total of 10 turns in Alaska he
freezes. Those turns don't have to be successive ones. If Homer
leaves and re-enters Alaska the count down for his 'time remaining
before he freezes' will continue where it left off.
|
|
|
- Enhanced version: Homer has to spend a total of 10 successive
turns in Alaska before he freezes. If he leaves and re-enters Alaska
then the count down will start again at the beginning (he has 10 turns
before he freezes).
|
|
- When Homer makes it back to Springfield the game is won and a
suitable congratulatory message should be displayed.
|
|
- The agents of the EPA can move (in a purely random fashion).
Agents will only move to an empty (contains a space) and adjacent
square with a one in nine probability of a particular square
being picked (there's eight agent squares plus there's a chance that
the agent won't move). (JT's hint:
to implement this feature properly you need some way to track the
(row/column coordinates of each agent in a fashion somewhat similar to
how you tracked Homer's location- except that you now must track 6
pairs of row/column coordinates instead of just one pair. This feature is more challenging
than the others so you should leave it to near the end).
|
|
- The game can detect when an EPA agent is in a square that is
adjacent to Homer and end the game (with a suitable consolation
message being displayed).
|