Last-Modified: Dec. 9, 2003 16:42 EST

Name

Ex-Maze: The Recoding

Synopsis

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

Description

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).


See Also

Perl and CGI.pm

Version History


Copyright and License

Copyright 2003 by Beau Holder (eholder@marlboro.edu)
You may modify/distribute this under the same terms as Perl itself.