aboutsummaryrefslogtreecommitdiff
path: root/src/world.rs
diff options
context:
space:
mode:
authorGuillaume Pasquet <dev@etenil.net>2019-11-18 06:24:18 +0000
committerGuillaume Pasquet <dev@etenil.net>2019-11-18 06:24:18 +0000
commit73259e32450370ff51e984abb83c0e30dafc4f50 (patch)
tree5ca5a01a5df3cd17a89cd9247824007a9f4421f5 /src/world.rs
parentcb61c55ae7394557359fde443d4568780401428c (diff)
Make corridors look better
Diffstat (limited to 'src/world.rs')
-rw-r--r--src/world.rs14
1 files changed, 14 insertions, 0 deletions
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);
}
}