private void MakeRoom(DungeonMap map, Rectangle Room) { foreach (Cell cell in map.GetAllCells()) { map.SetCellProperties(cell.X, cell.Y, true, true, true); } // Set the first and last rows in the map to not be transparent or walkable foreach (Cell cell in map.GetCellsInRows(0, _height - 1)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } // Set the first and last columns in the map to not be transparent or walkable foreach (Cell cell in map.GetCellsInColumns(0, _width - 1)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } }
public DungeonMap CreateMap() { _map.Initialize(_width, _height); foreach (Cell cell in _map.GetAllCells()) { _map.SetCellProperties(cell.X, cell.Y, true, true, true); } foreach (Cell cell in _map.GetCellsInRows(0, _height - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } foreach (Cell cell in _map.GetCellsInColumns(0, _width - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } return(_map); }
public void MakeExteriorWall(DungeonMap map, Rectangle rect) { int height = rect.Height; int width = rect.Width; foreach (Cell cell in map.GetAllCells()) { map.SetCellProperties(cell.X, cell.Y, true, true, true); } foreach (Cell cell in map.GetCellsInRows(0, height - 1)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } // Set the first and last columns in the map to not be transparent or walkable foreach (Cell cell in map.GetCellsInColumns(0, width - 1)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } }
//Simple map plan public DungeonMap CreateMap() { //Initialize every cell //See in sight, walkable, explored, etc. _map.Initialize(_width, _height); foreach (Cell cell in _map.GetAllCells()) { _map.SetCellProperties(cell.X, cell.Y, false, true, true); } //Set the first and last rows in the map to not be transparent or walkable foreach (Cell cell in _map.GetCellsInRows(0, _height - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } //Set the first and last columns in the map to not be transparent or walkable foreach (Cell cell in _map.GetCellsInColumns(0, _width - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } return(_map); }
// generate a new map public DungeonMap CreateMap() { // init every cell in the map by setting walk, transparency and explored to true _map.Initialize(_width, _height); foreach (Cell cell in _map.GetAllCells()) { _map.SetCellProperties(cell.X, cell.Y, true, true, true); } // set the first and last rows in the map to not be transparent or walk foreach (Cell cell in _map.GetCellsInRows(0, _height - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } // set the first and last columns in the map to not be transparent or walk foreach (Cell cell in _map.GetCellsInColumns(0, _width - 1)) { _map.SetCellProperties(cell.X, cell.Y, false, false, true); } return(_map); }