Learn how to create procedural dungeons in part three of one of the most comprehensive, well written and illustrated tutorials on tilemaps.

Article by Richard Davey. Posted on 30th Aug 2018.   @phaser_


Michael Hadley has been writing a series of tutorials on using tilemaps in Phaser 3. In the third part he covers how to create a proceduarly generated dungeon:

"This post builds on the idea of static vs dynamic tilemap layers that we talked about last time. The code we’re going to build in this post is based on one of my contributions to Phaser Labs. It was definitely the example I had the most fun making, and it conveniently covers a lot of additional parts of the dynamic tilemap layer API that we haven’t covered yet — from randomizing tiles to using per-tile transparency to create shadows.

We’ll start by getting comfortable with a dungeon generator library using vanilla HTML & JS. From there, we’ll start bringing in Phaser and progressively building out our endless dungeon world."

Michael was the developer responsible for coding most of the tilemap API inside of Phaser 3, so you can be sure this is a detailed and well researched tutorial, not just another 'export your map from Tiled' affair.

As with the first one, the tutorial is extremely well written, with plenty of great illustrations and explanations of the concepts behind tilemaps and how they work in Phaser. As you'd expect, the code is all available in GitHub too, and there are copious embedded examples. This is another masterclass in both tutorial writing and the use of tilemaps, so I'd urge anyone who plans to use them to read it.

Read More