Example #1
0
        //When the game is over to win or lose
        private void EndGame()
        {
            ControllersGame.Update(user);//Update points
            Form temp = this.FindForm();

            temp.Controls.Clear();
            if (MessageBox.Show("¿Desea jugar otra partida?",
                                "Consulta",
                                MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                //Reload Data al newForm
                GameData.InitializeGame();
                //Application.Restart();
                LoadTiles();
                LoadPlayer();
                LoadPanel();
                temp.Close();
                FrmGame newGame = new FrmGame(user);
                newGame.Show();
            }
            else
            {
                //Restart App!
                Application.Restart();
            }
        }
        private void newGame(User u)
        {
            Form temp = this.FindForm();

            temp.Hide();
            //temp.Dispose();
            FrmGame game = new FrmGame(u);

            game.ShowDialog();
        }