private void GenerateMap() { Random rand = new Random(); for (int x = 0; x < grid.GetLength(0); x++) { for (int y = 0; y < grid.GetLength(1); y++) { //bottom left corner is (9,0) instead of (0,0) IspaceGen(x, y, rand); } } grid[9, 0] = new BlankSquare(); grid[0, grid.GetLength(1) - 1] = new StairSquare(); }
private void IspaceGen(int x, int y, Random rand) { int temp = rand.Next(0, 1000); if (temp >= 0 && temp < 125) { grid[x, y] = new TreasureSquare(); } else if (temp >= 125 && temp < 300) { grid[x, y] = new EnemySquare(); } else if (temp >= 300 && temp < 425) { grid[x, y] = new TrapSquare(); } else { grid[x, y] = new BlankSquare(); } }