public MinesweeperForm() { InitializeComponent(); gameBoard = new Board(); Controls.Add(gameBoard); gameBoard.NewGame(); DifficultyRadioButtons(gameBoard.GetDiffLevel()); }
/// <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); }
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(); }
private void newGameStripMenuItem1_Click(object sender, EventArgs e) { gameBoard.NewGame(); }
private void Form1_Load(object sender, EventArgs e) { //start first game in beginner mode game = new Game(this); game.NewGame(); }
private void beginnerToolStripMenuItem_Click(object sender, EventArgs e) { SetModeCheck(GameModes.EASY); game.SetGameMode(GameModes.EASY); game.NewGame(); }