private void BtnNewGame_Click(object sender, EventArgs e)
 {
     this.Hide();
     game.Start();
     newForm = new MainForm(game);
     newForm.ShowDialog();
 }
Example #2
0
 private void СохранитьИгруToolStripMenuItem_Click(object sender, EventArgs e)
 {
     game.Stop();
     try
     {
         using (FileStream stream = File.Open("LastGame.game", FileMode.OpenOrCreate))
             game.SaveGame(stream);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     game.Start();
 }
        public StartupForm()
        {
            InitializeComponent();

            BackColor             = back;
            btnNewGame.BackColor  = back;
            btnPrevGame.BackColor = back;
            btnExit.BackColor     = back;

            game = new Game();
            game.Initialize(10000000, DateTime.Now);
            this.Hide();
            game.Start();
            newForm = new MainForm(game);
            newForm.ShowDialog();
        }