Exemplo n.º 1
0
        public void setMazeDesign(PictureBox[,] pic)
        {
            //mazeDesign = new TileBox[mapheight, mapwidth];
            TileBox[,] tile = new TileBox[mapheight, mapwidth];
            for (int i = 0; i < mapheight; i++)
            {
                for (int j = 0; j < mapwidth; j++)
                {
                    TileBox tl = new TileBox();
                    if (pic[i, j].BackColor == Color.SteelBlue)
                    {
                        tl.sign    = 'x';
                        tile[i, j] = tl;

                        /*
                         * mazeDesign[i, j].sign = 'x';
                         * mazeDesign[i, j].tampilan = pic[i, j];
                         */
                    }
                    if (pic[i, j].BackColor == Color.Transparent)
                    {
                        tl.sign    = 's';
                        tile[i, j] = tl;

                        /*
                         * mazeDesign[i, j].sign = 's';
                         * mazeDesign[i, j].tampilan = pic[i, j];
                         */
                    }
                    if (pic[i, j].BackColor == Color.Yellow)
                    {
                        tl.sign    = 'f';
                        tile[i, j] = tl;

                        /*
                         * mazeDesign[i, j].sign = 'f';
                         * mazeDesign[i, j].tampilan = pic[i, j];
                         */
                    }
                    if (pic[i, j].BackColor == Color.White)
                    {
                        tl.sign = '0';
                        //tl.tampilan = pic[i, j];
                        tile[i, j] = tl;

                        /*
                         * mazeDesign[i, j].sign = 'x';
                         * mazeDesign[i, j].tampilan = pic[i, j];
                         */
                    }
                    mazeDesign = tile;
                }
            }
        }
Exemplo n.º 2
0
 public void CreateLogicBlankMaze()
 {
     mazeDesign = new TileBox[mapheight, mapwidth];
     for (int i = 0; i < mapheight; i++)
     {
         for (int j = 0; j < mapwidth; j++)
         {
             TileBox tl = new TileBox();
             if ((i == 0) || j == 0 || (i == mapheight - 1) || (j == mapwidth - 1))
             {
                 tl.sign          = 'x';
                 mazeDesign[i, j] = tl;
             }
             else
             {
                 tl.sign          = '0';
                 mazeDesign[i, j] = tl;
             }
         }
     }
 }