Example #1
0
 private void newGameButton_Click(object sender, EventArgs e)
 {
     Pet.NewGame();
     MainGameUI mainGameUI = new MainGameUI();
     this.Hide();
     mainGameUI.ShowDialog();
     this.Show();
 }
Example #2
0
        private void loadGameButton_Click(object sender, EventArgs e)
        {
            // Load game from saveGame.txt.
            bool saveFileExists = Pet.LoadGame();
            if (!saveFileExists)
            {
                MessageBox.Show("No save file found! Starting new game...");
                Pet.NewGame();
            }

            // Show main game window.
            MainGameUI mainGameUI = new MainGameUI();
            this.Hide();
            mainGameUI.ShowDialog();
            this.Show();
        }