diff options
author | Guillaume Pasquet <dev@etenil.net> | 2019-11-18 06:24:18 +0000 |
---|---|---|
committer | Guillaume Pasquet <dev@etenil.net> | 2019-11-18 06:24:18 +0000 |
commit | 73259e32450370ff51e984abb83c0e30dafc4f50 (patch) | |
tree | 5ca5a01a5df3cd17a89cd9247824007a9f4421f5 | |
parent | cb61c55ae7394557359fde443d4568780401428c (diff) |
Make corridors look better
-rw-r--r-- | src/state.rs | 1 | ||||
-rw-r--r-- | src/world.rs | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/state.rs b/src/state.rs index 3cc7c05..cfda88c 100644 --- a/src/state.rs +++ b/src/state.rs @@ -26,7 +26,6 @@ impl State { pub fn init(&mut self) { self.dungeon.generate(); self.switch_level(0); - eprintln!("{:?}", self.current_level().get_start_point()); self.player.place(self.current_level().get_start_point()); } 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); } } |