Exemple #1
0
        private void initMaze()
        {
            blocks = new MazeBlock[sizeY, sizeX];

            for (int y = 0; y < sizeY; y++)
            {
                for (int x = 0; x < sizeX; x++)
                {
                    blocks[y, x] = new MazeBlock();
                }
            }
            subs    = new List <SubMaze>();
            randGen = new Random();
            subs.Add(new MazeGame.SubMaze(-1, sizeX, sizeY, -1, dir.NORTH, randGen));
            startCol = subs[0].splitIdx + -1;
        }
Exemple #2
0
        void drawBlock(int row, int col)
        {
            Point     loc   = blockLocs[row, col];
            MazeBlock block = myMaze[row, col];

            if (!block.N_open)
            {
                spriteBatch.Draw(blackBox, getNorthRect(loc), Color.White);
            }
            if (!block.S_open)
            {
                spriteBatch.Draw(blackBox, getSouthRect(loc), Color.White);
            }
            if (!block.E_open)
            {
                spriteBatch.Draw(blackBox, getEastRect(loc), Color.White);
            }
            if (!block.W_open)
            {
                spriteBatch.Draw(blackBox, getWestRect(loc), Color.White);
            }
        }