Emerge

Games Design
A site for players and programmers of Apple Mac games

Guy Walker 2003


«
 
Cocoa
Doom
Flash
HTML
Logo
Script
WTC
   
Maze - builder and solver

Maze Mania

This Stagecast sim is based on a maze writing algorithm which is described in detail at maze.com. It ensures that the maze is always solveable, with only one and only one path between start and finish. ie no 'loops' or 'islands' are formed.

In this Stagecast version there are no 'X-road' pieces. The only branches to the maze are 'T' junctions. This simplifies the rule writing greatly.

Once a dead end is reached, all maze pieces are checked. Those surrounded on all four sides are 'fossilised'. ie changed from outline to solid form with no rules attached.
The other pieces are available for branching and are marked with a red square. These are removed 50% at a time, eventually leaving one randomly selected piece to continue the maze path.

Once the maze is drawn, four ghosts are released to solve it. They choose a random direction at each 'T' junction. The first ghost to finish the maze will cause the whole sim to reset and begin again.

Maze Creation Rules

1) Find a random starting place and direction.
2) Move one step at a time either forward, left or right.
3) Keep going until trapped on all four sides, forming a 'dead end'.
4) Then, go back over the maze already drawn and choose either a straight or a corner maze piece.
5) Branch out from here, creating a 'T' junction piece.
6) Continue to move either forward, left or right until again trapped.
7) Keep going until maze is complete.

View Code

Controls:
No controls for this self looping sim. Just watch.

 
Stagecast Creator, Stagecast Player, and Stagecast Web Player are trademarks of Stagecast Software, Inc.
Java is a registered trademark of Sun Microsystems, Inc.


Cocoa | Doom | Flash | HTML | Logo | Script | WTC