Skip to content

Bery0za/Mazeraptor

Repository files navigation

Mazeraptor

Mazeraptor

Do you need mazes? This library is for you. Mazeraptor is a .NET library able to generate rectangular, circular, hexagonal or triangular mazes with various generator types and parameters and find paths between cells.

IStructure structure = new CircularStructure(new CircularParameters(10, 1.2f));
MazeGenerator generator = new RecursiveBacktrackerGenerator();
Maze maze = new Maze("Theseus", structure, generator);
maze.Generate();

maze.Seed = "And the Bad Seeds";
maze.Generate(); // Same structure and generator but this the other seed

Currently supported generators

RecursiveBacktracker(firstCellSelector, leftCellSelector, neighborCellSelector)

Tends to form long twisty passages. leftCellSelector allows to choose which cell has to be processed next after the passage has been formed. neighborCellSelector defines which neighbor of a cell is processed next.

GrowingTree(firstCellSelector, carvingCellSelector, leftCellSelector, neighborCellSelector)

One of the most powerful generator in the world of mazes. It may act as Prim generator or as Recursive backtracker. carvingCellSelector is a magic function which makes growing tree so powerful. After some cell has been processed and its neighbors been added to the carving list you can define which cell process next. Other functions are the same as in RecursiveBacktracker.

Currently supported solvers

  • AStar (Dijkstra)
  • Breadth first
  • Depth first

You may also use your favorite photos to define a shape of the maze (depending on pics’ alpha channel or lightness or any other function). You just have to wrap your pic in IShape interface and tell which pixels are interior.

Planned features

  • Voronoi structure
  • Other generators
  • Performance optimizations

Explore Mazeraptor.Forms to find samples of usage and build your own mazes with the app.

Releases

No releases published

Packages

No packages published

Languages