MazeApplet


go straight to the applet

About the program:

This applet was originally written in 1997, for JDK 1.0.2. The 3D view is very basic with the wall drawn in a solid color with a border round it, to make the performance acceptable on the 486 I was using at the time.

Updated 12/12/2004:
Updated 18/12/2004:


Instructions:

The game runs in it's own window. When the applet starts just press the open button and the window will appear.

Select the maze size using the + and - buttons: The inner buttons change the value by 1 and the outer buttons change it by 10.

Then generate a new maze by clicking the generate button.

When the maze has been generated you will see the 3D view. To toggle between this and the map, right click or control-click in the window.

You move using the arrow keys, up/down for forewards and backwards and left/right to rotate left and right.

Pressing solve gets the computer to solve the maze and display the correct route. By default the solution is only shown in the 2D view. From the options menu you can toggle showing the solution in the 3D view by drawing the floor in a darker colour.

Restart puts you back to the start of the current maze and hides the solution.


Options:

You can set the start and end positions for the maze from the options menu. You can choose any of the corners or the center.

You can also set the 'strength' of the maze generating algorithm which determines how many cells it must use before it considers the maze completed. Lower values are faster but may leave some large blocks unused. The default is 95% which takes about two minutes for a 50 * 50 maze on a 486DX-50 (running locally).

solving a maze is usually about 2 or 3 times as fast as generating.

To abort the generation if it is taking too long, press solve and the generator will stop. Similarly pressing generate will abort a solve.

If the "show compass" option is selected, N, E, S or W is printed in the middle of the view to show the direction you are facing.

If the "show location" option is selected, the x,y coordinates of the player are shown in the middle of the view.

If the "show solution in 3D view" option is selected, the solution will be shown in the 3D view after the solve button is pressed, by drawing the floor in a darker colour.


Bugs:

When the window is exposed after being hidden behind another window it is not repainted. If this happens click inside the window and it will repaint.

If the game stops responding to keyboard input, click inside the window to return the focus to it.


The Applet:

your browser has failed to display this applet

Download all source code and binaries

Zip [35k]

This applet is Free Software and you are welcome to redistribute and/or modify it under the terms of the GNU General Public License.


Maze related links: