From 73259e32450370ff51e984abb83c0e30dafc4f50 Mon Sep 17 00:00:00 2001 From: Guillaume Pasquet Date: Mon, 18 Nov 2019 06:24:18 +0000 Subject: Make corridors look better --- src/world.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/world.rs') diff --git a/src/world.rs b/src/world.rs index b0be50a..f9c8b2e 100644 --- a/src/world.rs +++ b/src/world.rs @@ -171,6 +171,13 @@ impl Corridor { grid.set_tile(x, y, TileType::Floor); grid.set_empty_tile(x + 1, y, TileType::Wall); } + // Wall ends + grid.set_empty_tile(x - 1, self.start.1, TileType::Wall); + grid.set_empty_tile(x, self.start.1, TileType::Wall); + grid.set_empty_tile(x + 1, self.start.1, TileType::Wall); + grid.set_empty_tile(x - 1, endy, TileType::Wall); + grid.set_empty_tile(x, endy, TileType::Wall); + grid.set_empty_tile(x + 1, endy, TileType::Wall); } fn tile_horizontal(&self, grid: &mut TileGrid) { @@ -181,6 +188,13 @@ impl Corridor { grid.set_tile(x, y, TileType::Floor); grid.set_empty_tile(x, y + 1, TileType::Wall); } + // Wall ends + grid.set_empty_tile(self.start.0, y - 1, TileType::Wall); + grid.set_empty_tile(self.start.0, y, TileType::Wall); + grid.set_empty_tile(self.start.0, y + 1, TileType::Wall); + grid.set_empty_tile(endx, y - 1, TileType::Wall); + grid.set_empty_tile(endx, y, TileType::Wall); + grid.set_empty_tile(endx, y + 1, TileType::Wall); } } -- cgit v1.2.3