Example #1
0
 /// <summary>
 /// Restarts the game with same settings.
 /// </summary>
 internal void Restart()
 {
     gameField.CleanField();
     gameField.GenBombs();
     endForm.Close();
     EndState = false;
     gameForm.Invalidate();
 }
Example #2
0
        /// <summary>
        /// Creates a new game with desired dimensions and specified bomb probability.
        /// </summary>
        /// <param name="x_tiles"># of horizontal tiles.</param>
        /// <param name="y_tiles"># of vertical tiles.</param>
        /// <param name="bomb_prob">Probability of a tile to be a bomb.</param>
        public Game(uint x_tiles, uint y_tiles, double bomb_prob)
        {
            gameField = new Field(this, x_tiles, y_tiles, bomb_prob);
            gameField.GenBombs();

            gameForm = new GameForm(this);
            gameForm.Show();
        }