Example #1
0
        public void drawMap()
        {
            this.sColor = mapColor();
            //determine if a map exists, if so, unload it.  Otherwise, initialize a fresh oMapArray.
            if (oMapArray == null)
            {
                // do nothing
                oMapArray = new TileButton[iXSize, iYSize];
            }
            else
            {
                unloadMap();
            }
            lCoords = PathBuilder.MakeViableMap(iXSize, iYSize);

            for (int xPos = 0; xPos < iXSize; xPos++)
            {
                for (int yPos = 0; yPos < iYSize; yPos++)
                {
                    oMapArray[xPos, yPos] = NewRandomTile(xPos, yPos, sColor);
                }
            }
            CompleteMap();
        }