DEV Community

Cover image for Dungeon Sweep: Knight -- devlog 001
JavaScript Joel
JavaScript Joel

Posted on • Originally published at joel.net

Dungeon Sweep: Knight -- devlog 001

I recently decided I wanted to make an indie game. I have had this idea for a while and I think it's about time.

The idea is a variation of Minesweeper with RPG elements. I'm thinking about calling it Dungeon Sweep: Knight.

Art

I can't art, so I decided to go hunting for a ready-to-use tileset. A quick google search brought me to a 16x16-dungeon-tileset with a style that I can only describe as perfect.

Dungeon Map

Game Engine

After barely doing any research, I landed on PhaserJS. My decision primarily was it still being in active development and not abandoned yet like all the others. So let's give it a try!

I know I can use Apache Cordova to turn this into native Android and iOS. I don't know how well that process works, but that's a problem for Future Joel, not Today Joel.

Generating a Dungeon

Now that I have the perfect tileset in hand, it's time to create a dungeon. This ended up being a lot harder than I thought it would be. My initial plan was to hand-create dungeons using plain text files. Run that through a function and bam, dungeon!

Example early dungeon map (that didn't work):

#########################
#     #    x        P   #
#     #        x        #
#     ############      #
#   x       x       x   #
#########################
Enter fullscreen mode Exit fullscreen mode

I had a lot of difficulties with this. The first is I am using # to draw a top wall, left wall, right wall, and bottom wall. The graphics were different for each wall. This was going to be difficult.

So I decided to run these problems through ChatGPT. Let ChatGPT solve this so I can get on with the fun stuff. Unfortunately, ChatGPT was TERRIBLE at this. Even worse than me. So that wasn't gonna work.

After realizing how difficult a problem I gave myself, I stepped back and did a search on NPM for dungeon generators. There were MANY on there, but one stuck out.

Open Source Dungeon Generator

@halftheopposite/dungeon was exactly what I was looking for. It was configurable and I was confident I could make it work.

I ended up abandoning my custom dungeon generator for this one.

The dungeon generator used a different tileset, so I tweaked it until my tileset would work with it. This ended up being a little more difficult than I had anticipated since each dungeon tile returned was a number. So I had to map each number to a graphic. This was tedious but once it was done I fired up the game and it generated this beautiful map!

Beautiful Map

I'm trying to keep the game as a 9:16 portrait ratio so mobile view works well.

What's Next

I have a solid base for my game, engine, graphics, random dungeons that look great. Next I'll be adding the gameplay mechanics. I'll have to drop down some enemies, lay a fog of war on top.

I think I'll have the Knight run around chopping at everything, I think that could also be fun.

Cheers 🍻

Top comments (0)