Esempio n. 1
0
 private static string[,] StartMap(int width, int height)
 {
     string[,] GameMap = new string[width, height];
     GameMap           = CityMap.BlankArray(width, height);
     GameMap           = CityMap.Rectangle(width, height, 0, 0, GameMap);
     GameMap           = CityMap.Building(width, height, 11, 5, 4, 2, "Shop", "right", GameMap);
     GameMap           = CityMap.Building(width, height, 21, 5, 20, 2, "ArmorSmith", "down", GameMap);
     GameMap           = CityMap.Building(width, height, 21, 5, 4, 9, "WeaponSmith", "right", GameMap);
     GameMap           = CityMap.Building(width, height, 15, 10, 4, 14, "Arena", "right", GameMap);
     return(GameMap);
 }
Esempio n. 2
0
        private static string[,] Building(int width, int height, int buildingWidth, int buildingHeight, int OffSetX, int OffSetY, string text, string WhereDoors, string[,] rectangle)
        {
            string[,] GameBulding = new string[width, height];
            GameBulding           = CityMap.Rectangle(buildingWidth, buildingHeight, OffSetX, OffSetY, rectangle);
            string Text = text;

            for (int i = 0; i < text.Length; i++)
            {
                GameBulding[2 + OffSetX + i, (buildingHeight / 2) + OffSetY] = Convert.ToString(text[i]);
            }
            switch (WhereDoors)
            {
            case "up":
            {
                GameBulding[buildingWidth / 2 + OffSetX, OffSetY - 1] = "D";
                break;
            }

            case "down":
            {
                GameBulding[buildingWidth / 2 + OffSetX, buildingHeight + OffSetY] = "D";
                break;
            }

            case "left":
            {
                GameBulding[OffSetX - 1, height / 2 + OffSetY] = "D";
                break;
            }

            case "right":
            {
                GameBulding[buildingWidth + 1 + OffSetX, buildingHeight / 2 + OffSetY] = "D";
                break;
            }
            }
            return(GameBulding);
        }