Last-Modified: Dec. 9, 2003 16:42 EST
Ex-Maze: The Recoding
Starts in ex.cgi:
init() - Initializes needed parameters and defines all the Global Variables
I'll need.
Get_Info() - Opens file that contains the room-just-left's data; Gathers and stores all info for
@room_info, $room, and $new_room.
Print_Board(room) - Takes the roomed just moved into and gets the board layout for that room from a static
room file, then prints a table with images diplaying room.
Print_Controls() - Prints a table with movement buttons**
Print_Status() - Print player's current status (time*, moves left, coins*)
Win_or_Lose() - If user moved into the exit, they win, go to score calculation* and then to highscores
(if player has a high score will add their score to the highscores)*. If player has run out of time* or
moves then redirect to loser's script/page (still calculating score)*.
Moves to get_name.cgi:
This simply prints an HTML form to get player's name (and pass on moves/time to highs.cgi)
Ends at highs.cgi:
Not broken into subroutines... though makes sure that player's name contains no non-word characters (by
deleting them); figures out how much "bonus" time you have left; calculates your score; gets current high
score list from a .log file; adds score to high score list; sorts list and drops lowest score; clears the
.log file containing highs list; reprints new, sorted list to .log file; prints a table displaying high
scores (bolding entry if you just set a high score);
*Not implemented at all yet.
**Eventually will be removed in favor of directly clicking on the board to move
Play "Ex-Maze: The Recoding" (Recently renamed)!
This program uses preset 'rooms' which are graphically printed out using CGI. The player always
starts in the same room (ie: bottom right corner of the maze - room 1). By clicking on the
directional buttons, the player must attempt to navigate a special pattern in a limited number of
moves (predetermined at this point).
For now, a winner (the player figures out the maze) is redirected to a winner's page, and a loser
(who fails to find the exit within move limit) is redirected to a loser's page... I intend to
eventually add a highscore setup that will keep track of the top 10, 25, 50??? highscores (haven't
started to develop much yet).
I had initially intended for the maze to have a timer of sorts (initially setting a time limit to
solve the maze). The limited moves system was simpler to implement, and suits well enough for now,
though I do want to get the timer subroutine up and running.
After enough (programming) time the player will be given a set number of coins (~100) that they can
drop in the rooms giving the player something to help him/her navigate the maze. The number of coins
in each room must be reset to 0 upon a new game being started (this will cause problems when and if
more than one person starts a game at one time, or when someone starts a game while another game is
in progress. This problem will be partially/mostly alliviated when the rooms are dynamically
generated and the information for each game can be stored in a temporary directory (that is cleared
after game is ended).
Perl and CGI.pm
- v 0.01 : Oct. 8, 2003
- Creation of new directories and program files.
- Skeleton Code, however not funtional yet
- This Documentation
- v 0.05 : Oct. 27, 2003
- Coded basic structure of subroutines
- Haven't started functionality tests
- v 0.06 : Nov. 6, 2003
- Changed the location of tiles
- Edited room text files to refer to local tiles
- Changed all html coding in subroutines to printed html
- v 0.11 : Nov. 12, 2003
- Added logs directory for debugging
- created .log files for init(), Get_Info(), and Win_or_Lose()
- sub test_init() complete and fully functional
- sub test_Get_Info() complete and fully functional
- sub test_Win_or_Lose() complete and fully functional
- v 0.20 : Nov 19, 2003
- Renamed Ex- Maze to "Ex-Maze: The Recoding"
- "Ex-Maze: The Recoding" is finally functional (potential unknown bugs not withstanding)
- Finished adding all the debugging subroutines
- Wrote in Print_Status() and its debugging subroutine
- Created both won.html and lost.html
- Modified index.html minorly
- Recoded Print_Controls(), fixing errors w/ sending params
- Added test_incoming_parameters() to test paramerters as they come in
- Added "pass" parameter to keep track of the how many passes were made
- Created log file for test_incoming_parameters()
- Modified test_init() to give more accurate feedback
- v 0.21 : Nov. 19, 2003
- Found and fixed error with Win_or_Lose (failed to redirect on win)
- v 0.32 : Nov. 24, 2003
- Created highs.cgi and get_name.cgi
- Modified ex.cgi to redirect to get_name.cgi on win or loss
- Setup new .log, highs.log, to keep high score list saved
- Modified highs.cgi to know when its called by win or loss (to prevent losers from setting
high score on time alone)
- Changed Win_or_Lose to go to get_name.cgi (and pass params correctly) on win OR go directly
to highs.cgi (passing no params - high.cgi knows what to do in this case) and show high scores
- v 0.43 : Dec. 3, 2003
- Check out the new look (I'll admit I didn't create the patterns though)
- Guess what! You actually win when you leave the exit! That too a bit to figure out...
- Reset all my test scores again 'cept the unachievable 1 mill score
- Got rid of some unnecessary variables / lines due to navigating on the map
- Added a little helping line explaining how to play below the reset button
- Changed the message diplay in highs.cgi to a preset message depending on win or loss
- Added some lines to highs.cgi to limit name length to 15 characters
- Modified the scoring system a little (you get more points for moves, have more time, and the
points for time left has increased as well)
- v 0.46 : Dec. 9, 2003
- Added two JavaScript timers to prevent the need for CGI to refresh every second to keep an
active counter running. Timers are: Display current play time and Display remaining bonus time.
- In the Works as of Nov. 24, 2003
- Thourough testing (ie: check every move to make sure there are no errors)
- Work on getting the paths to be dynamically generated (image maps not changed... just the way
rooms are linked - exit always leaving room 12 to the north)
- Much later on: Split game up into modes - limited moves or limited time, each with levels of
difficulty (more/less moves or time)
- Add a text field for player to keep notes??
- A more original (drawn by me) look, maybe increase the size
- View of Final Version (v 1.00):
- Maze path dynamically generated
- Two modes: Original Mode and Time Mode
- Three difficulties for each mode: Hard, Normal, Easy
- Scores will be presented upon completion of maze - Working
- Top 10-25 scores will be kept in a Highscores file (CGI/Logs) - Working
Copyright 2003 by Beau Holder (eholder@marlboro.edu)
You may modify/distribute this under the same terms as Perl itself.