示例#1
0
        /// <summary>
        /// Authors
        /// Sebastian Horton
        /// resets the fuse, updates the matrix and redraws the map.
        /// </summary>
        public bool resetBomb(bool bombPlaced)
        {
            if (bombFuse <= -2)
            {
                Matrices.updateBlocks();
                Matrices.updateWalkable();
                Matrices.removeBombs();
                Map.colourMap();

                return(bombPlaced = false);
            }
            else
            {
                return(bombPlaced = true);
            }
        }
示例#2
0
        /// <summary>
        /// Authors
        /// Sebastian Horton, Elliot McArthur
        ///constructs the map in the mainwindow.
        ///Also meshes the "pillars" and "blocks" matrices and sets the walkable space at the start of the game.
        /// </summary>
        public Map(Canvas c)
        {

            Matrices.updateBlocks();
            Matrices.updateWalkable();

            for (int x = 0; x < 9; x++)
            {
                for (int y = 0; y < 15; y++)
                {
                    Matrices.map[y, x] = new Rectangle();
                    Matrices.map[y, x].Height = 64;
                    Matrices.map[y, x].Width = 64;



                    Canvas.SetTop(Matrices.map[y, x], 64 * x);
                    Canvas.SetLeft(Matrices.map[y, x], 64 * y);
                    c.Children.Add(Matrices.map[y, x]);

                }
            }
            colourMap();
        }