A simple maze generator using a backtracker.
clone this repo !
// Instantiate a new maze
const maze = new Maze({parentSelector: '.container', gridSize: 500, cellSize: 20, id: 'maze'});
// Perform this on each tick
const animationCallback = () => {
if(!m.done()){
m.generateMaze();
}else{
a.stop();
}
};
// Render maze to screen
maze.render();
// Get a new Animator instance
const anim = new Animator(10, animationCallback);
// Start animation
anim.start();