Introduction to Build a Dungeon Crawler

Get a brief introduction to what you’ll learn in this chapter.

We'll cover the following

What will we learn?

In this chapter, we’ll design a dungeon-crawler game by following the template provided in Short Game Design Documents. We’ll start by assembling the building blocks that make up the design, creating an adventurer able to walk around a randomly generated dungeon.

We’ll then divide our code into modules, taming complexity as the program grows and helping us isolate bugs.

We’ll then learn to store a map in a structure of tiles and how this leads to an efficient and simple map-rendering system.

Our next step is to add a player and make them move around the map while not walking through walls.

Finally, we’ll implement a random map-generation system—carving out a dungeon similar to the original Rogue or Nethack. Mastering these building blocks offers basic knowledge of tile-based games; drawing a map and letting the player explore it.

All our code so far has been contained in a single main.rs file. As our game grows, we’ll find it easier to combine similar code in modules.

Get hands-on with 1200+ tech skills courses.