A tutorial on how to create perfect mazes for your game, including Phaser 3 plugin and demo code.

Posted on 1st Feb 2019. Follow @phaser_ and get the Phaser World newsletter.


This is a great tutorial by supernapie all about creating procedural mazes in Phaser 3 using a combination of a handy npm package and a custom Phaser 3 plugin: "A nice way to add variety to your game is random levels. In this article i will explain how i made the mazes for Esciit and Acid Sink.

Straight to the point: I didn't figure out the math to create these mazes myself. Actually I only had to implement an existing npm-package called generate-maze and visualize the output with Phaser objects. The package is a javascript implementation of Eller's algorithm. The algorithm is said to create 'perfect' mazes, with a single path between any two cells.

The generate-maze library only generates a two-dimensional array of maze cells, which have the following properties..."

Read More

The first book on the creation of HTML5 cross platform games using Phaser 3 and other free software.
  • By Emanuele Feronato
  • 155 Pages
  • 28 Source Code Examples
  • Build a complete game from start to finish
  • Cross Platform
  • Scaling for devices
Buy Now