void MapSelection() { bool needToMakeMap = true; while (needToMakeMap) { Console.WriteLine("Do you want to make your own map?"); Console.WriteLine("Y to make your map size"); Console.WriteLine("X to use defult map"); switch (Console.ReadKey().Key) { default: Console.WriteLine("Wrong input"); break; case ConsoleKey.Y: needToMakeMap = false; int length; int hight; int spawnWallChance; hight = userMapSizeCreation("hight"); length = userMapSizeCreation("length"); spawnWallChance = spawnChanceSwitch(); map = new Map(hight, length, spawnWallChance); break; case ConsoleKey.X: map = new Map(10, 10, 0); needToMakeMap = false; break; } if (needToMakeMap == false) { IslandGenerator islandGenerator; map.GenerateMap(); islandGenerator = new IslandGenerator(map.GetMapHight(), map.GetMapLength()); islandGenerator.CreateIslands(level, map); } } }
void NextMap() { IslandGenerator islandGenerator; if (loadInfo) { map = new Map(mapHightLoad, mapLengthLoad, mapSpawnWallChanceLoad); map.GenerateMap(); islandGenerator = new IslandGenerator(map.GetMapHight(), map.GetMapLength()); islandGenerator.CreateIslands(level, map); Hud.InfoText = "Map Loaded, You Are at LEVEL: " + level; loadInfo = false; } else { map = new Map(map.GetMapHight(), map.GetMapLength(), map.GetReducedWallSpawnChance()); map.GenerateMap(); islandGenerator = new IslandGenerator(map.GetMapHight(), map.GetMapLength()); islandGenerator.CreateIslands(level, map); Hud.InfoText = "Advanced To LEVEL: " + level; } }