Пример #1
0
        private void OnGameOver()
        {
            Game.Over();
            GameTimer.Enabled = false;

            TetrisSave test;

            if (Game.Score > Game.Score2)
            {
                test = new TetrisSave("---", Game.Score, DateTime.Now - Game.GameStarted);//////////////////////
            }
            else//Game.Score<=Game.Score2
            {
                test = new TetrisSave("---", Game.Score2, DateTime.Now - Game.GameStarted);//////////////////////
            }

            if (Saver.HighScores.CanAdd(test) || Saver.HighTimes.CanAdd(test))
            {
                NRDialog = new NewRecordDialog();
                if (NRDialog.ShowDialog() == DialogResult.OK)
                {
                    test.UserName = NRDialog.UserName;
                    Saver.Save(test);

                    RForm = new RecordsForm(test);
                    if (RForm.ShowDialog() == DialogResult.OK)
                    {
                        NewGame();
                    }
                }
            }
        }
Пример #2
0
 void ТаблицаРекордовToolStripMenuItemClick(object sender, EventArgs e)
 {
     RForm = new RecordsForm(new TetrisSave());
     if (RForm.ShowDialog() == DialogResult.OK && Game.GameOver)
     {
         NewGame();
     }
 }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (timer.Enabled)
            {
                PauseGame();
            }

            RecordsForm recordsForm = new RecordsForm();

            recordsForm.TopMost = true;
            recordsForm.ShowDialog();
            PauseGame();
        }