Description
DEMO:
http://www.mediafire.com/file/cdp5me5g973mw6w/SimpleMazeGenerator_GMS23.zip/file
This is maze generation script, it using algorithm called as Recursive backtracker.
It's very simple to use: put somewhere in create event, initializing function and you done :)
maze_ds_grid = huder_mazeGen(width,height,noBorder,leftEntrance,rightEntrance,topEntrance,bottomEntrance,spaceMin,spaceMax, spaceSize, symmetryMode);
Possible settings:
- You can set size of maze width and height separately.
- You can determine whether your maze will have open borders or not.
- You can determine which maze's edge will have entrance.
- You can set amount of random holes that will be digged (spaceMin, spaceMax) and its size (spaceSize)
- You can set whether maze is symmetric on x, y or both axis.
Pack contains example of generating maze and re-generating, drawing maze and how to get position of entrances (if they exist)
Arguments:
- width -- Width of the maze expressed in tiles number not pixels
- height -- Height of the maze expressed in tiles number not pixels
- noBorder -- Whether maze will not have borders
- leftEntrance, rightEntrance, topEntrance, bottomEntrance* -- Set which maze's edge will have entrance
- spaceMin,spaceMax -- The amount of random holes placed within maze
- spaceSize -- Size of digged random holes
- symmetryMode -- 0 means no symmetry, 1 means x symmetry, 2 means y symmetry, 3 means xy symmetry
Returns:
Return index of created (ds_grid) data structure that will contain integers representing generated maze (0 - floor or 1 - wall).
Also this script will create 2 arrays mazeEntranceX[], mazeEntranceY[] these arrays can be used
to check position of each entrance. If value is equal to -1 that means there is no entrance.
use 0 for left, 1 for right, 2 for top, 3 for bottom entrance within array [] brackets.
End User Licence Agreement (EULA).
Age Rating: 4+
Versions
GMS1 - Version 1.0.2. Published March 18, 2017
- New argument added "spaceSize" size of empty holes that are placed randomly
GMS2 - Version 1.0.2. Published March 18, 2017
- Function name changed to huder_mazeGen()
- New argument added "spaceSize" size of empty holes that are placed randomly
Package contents
Loading, please wait
What is the issue?
Loading, please wait