Ejemplo n.º 1
0
 public MinesweeperForm()
 {
     InitializeComponent();
     gameBoard = new Board();
     Controls.Add(gameBoard);
     gameBoard.NewGame();
     DifficultyRadioButtons(gameBoard.GetDiffLevel());
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Start a new game.
        /// </summary>
        /// <param name="mines">number of mines to put on the board</param>
        /// <param name="x">horizontal size in tiles</param>
        /// <param name="y">vertical size in tiles</param>
        private void NewGame(int mines, int x, int y)
        {
            flags = new bool[x][];
            for (int i = 0; i < x; i++)
            {
                flags[i] = new bool[y];
            }

            game.NewGame(mines, x, y);
        }
Ejemplo n.º 3
0
        private void btnNewGame_Click(object sender, EventArgs e)
        {
            Game.NewGame();
            flowLayoutPanel1.Controls.Clear();
            flowLayoutPanel1.Controls.AddRange(Game.Tiles.ToArray <Control> ());
            btnNewGame.Image = Properties.Resources.Smiley;
            timer1.Enabled   = !Properties.Settings.Default.UnlimitedTime;

            //FOR TESTING
            //===========
            //foreach(var tile in Game.Tiles)
            //    tile.ShowValue();
        }
Ejemplo n.º 4
0
 private void newGameStripMenuItem1_Click(object sender, EventArgs e)
 {
     gameBoard.NewGame();
 }
Ejemplo n.º 5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //start first game in beginner mode
     game = new Game(this);
     game.NewGame();
 }
Ejemplo n.º 6
0
 private void beginnerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SetModeCheck(GameModes.EASY);
     game.SetGameMode(GameModes.EASY);
     game.NewGame();
 }