Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spearwolf/legendary-mazes
a tiny javascript library for creating legendary mazes ;-)
https://github.com/spearwolf/legendary-mazes
gamedev generative-art javascript maze-creation maze-generation-algorithms maze-generator mazes
Last synced: about 2 months ago
JSON representation
a tiny javascript library for creating legendary mazes ;-)
- Host: GitHub
- URL: https://github.com/spearwolf/legendary-mazes
- Owner: spearwolf
- License: mit
- Created: 2019-12-05T10:19:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-19T07:22:31.000Z (6 months ago)
- Last Synced: 2024-10-13T23:38:24.302Z (2 months ago)
- Topics: gamedev, generative-art, javascript, maze-creation, maze-generation-algorithms, maze-generator, mazes
- Language: JavaScript
- Homepage:
- Size: 2.05 MB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
L E G E N D A R Y M A Z E S
[![npm version](https://badge.fury.io/js/legendary-mazes.svg)](https://badge.fury.io/js/legendary-mazes)
A tiny javascript library for creating legendary mazes :sparkles:
![a legendary maze](./legendary-maze-1.png)
![a legendary maze animation](./legendary-maze.gif)This library is using a _recursive backtracker_ [algorithm for maze generation](https://en.wikipedia.org/wiki/Maze_generation_algorithm)
— I implemented it relatively freely because it was so much fun :smiley:Feel free to adapt, improve and extend the algorithm according to your needs - PR's are always welcome!
### Demo or Die
Just look at this codepen: https://codepen.io/spearwolf/full/yLePxBw
In order to run the local demo app you need to start a local http server:
```sh
npx serve
```Then simply call the following url with a browser of your choice: [http://localhost:5000/](http://localhost:5000/)
### Documentation
#### Getting Started
1. Install the module in your project
```sh
npm i legendary-mazes
```2. Import what you need
```js
import {
MazeGrid,
RecursiveBacktracker,
DistanceGrid,
MazeCanvasRenderer
} from 'legendary-mazes';
```#### API
Take a look into [./demo.js](./demo.js) or [./codepen/](./codepen/) for examples how to use this library.