Beispiel #1
0
 /// <summary>
 /// Initializes the grid. Includes re-construction of grid, InitializeCells() and LoadContent().
 /// </summary>
 /// <param name="dim">The dimension of the grid.</param>
 private void SetGrid(int dim)
 {
     MyGrid = new Grid(dim, getMinesFromDimension(dim), 40, "Grid");
     MyGrid.InitializeCells("mined");
     MyGrid.LoadContent(Content);
     InitGraphicsMode(MyGrid.height, MyGrid.height + MyGrid.CellHeight);
     MyGameState = GameState.Game;
 }
Beispiel #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // First, display a selection of mine dimensions.
            //InitializeMenu();
            InitGraphicsMode(600, 600);

            // dimension, # of mines
            MyGrid = new Grid(10, 7, 40, "Grid");
            MyMenu = new Menu(new Vector2(0, 0), "Menu2");
            Watch = new Stopwatch();
            SecondWatch = new Stopwatch();

            //Watch.Start();

            this.IsMouseVisible = true;

            base.Initialize();
        }