Added 2.7

This commit is contained in:
2022-01-26 00:29:38 +01:00
parent 174ad7ea56
commit 1fe967250e
6 changed files with 192 additions and 12 deletions

View File

@@ -11,6 +11,10 @@ pub enum TileType {
Floor,
}
const MAP_WIDTH: usize = 80;
const MAP_HEIGHT: usize = 43;
const MAP_COUNT: usize = MAP_HEIGHT * MAP_WIDTH;
pub struct Map {
pub tiles: Vec<TileType>,
pub rooms: Vec<Rect>,
@@ -56,14 +60,14 @@ impl Map {
pub fn new_map_rooms_and_corridors() -> Map {
let mut map = Map {
tiles: vec![TileType::Wall; 80 * 50],
tiles: vec![TileType::Wall; MAP_COUNT],
rooms: Vec::new(),
width: 80,
height: 50,
revealed_tiles: vec![false; 80 * 50],
visible_tiles: vec![false; 80 * 50],
blocked: vec![false; 80 * 50],
tile_content: vec![Vec::new(); 80 * 50],
width: MAP_WIDTH as i32,
height: MAP_HEIGHT as i32,
revealed_tiles: vec![false; MAP_COUNT],
visible_tiles: vec![false; MAP_COUNT],
blocked: vec![false; MAP_COUNT],
tile_content: vec![Vec::new(); MAP_COUNT],
};
const MAX_ROOMS: i32 = 30;