June 2021
Beginner
344 pages
8h 9m
English
Random dungeons are great, but sometimes you want to represent something specific. You might have a great idea for part—or even all—of a map. This has been used to great effect in many games. Games as varied as Diablo and Dungeon Crawl Stone Soup procedurally generate a large portion of their content—and intersperse pre-made sections called vaults.
Create a new file named map_builder/prefab.rs. Add the usual use crate::prelude::* and define your first prefabricated map section:
| | use crate::prelude::*; |
| | |
| | const FORTRESS : (&str, i32, i32) = (" |
| | ------------ |
| | ---######--- |
| | ---#----#--- |
| | ---#-M--#--- |
| | -###----###- |
| | --M------M-- ... |
Read now
Unlock full access