Exemple #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (_game1 == null) _game1 = new Sapper(_gameFieldGraph);
     _game1.RandomizeBomb();
     _game1.DrawGameFieldLines();
     _game1.DrawAllCells();
 }
Exemple #2
0
 private void Form3_Load(object sender, EventArgs e)
 {
     var game1 = new Sapper(_gameFieldGraph);
     //Задание размеров элементов и инициализация объекта GameFieldGraph;
     pictureBoxGameField.Height = Sapper.FieldSqY * Sapper.SquareF + 10;
     Height = pictureBoxGameField.Height + 80;
     pictureBoxGameField.Width = Sapper.FieldSqX * Sapper.SquareF + 10;
     Width = pictureBoxGameField.Width + 40;
     pictureBoxGameField.Top = FieldTop;
     pictureBoxGameField.Left = FieldLeft;
     pictureBoxGameField.BackColor = Color.LightGray;
     _gameFieldGraph = Graphics.FromHwnd(pictureBoxGameField.Handle);
     label1.Text = "Осталось обнаружить: " + game1.NumberOfBombLeft;
 }