June 2021
Beginner
344 pages
8h 9m
English
You’ve built an empty map and have a player who can walk around it. The structure is in place to handle walls, so it’s time to add a simple dungeon. In this section, you’ll learn to randomly place rooms, connect them with corridors, and build a dungeon for your adventurer to explore.
Make another new file named map_builder.rs. This file will contain the map building module. Add it to your prelude in main.rs:
| | mod map; |
| » | mod map_builder; |
| | mod player; |
| | |
| | mod prelude { |
| | pub use bracket_lib::prelude::*; |
| | pub const SCREEN_WIDTH: i32 = 80; |
| | pub const SCREEN_HEIGHT: i32 = 50; |
| | pub use crate::map::*; |
| | pub use crate ... |
Read now
Unlock full access