Пример #1
0
        /// <summary>
        /// Wird aufgerufen, wenn auf den Menüpunkt "Neues Spiel" geklickt wird
        /// </summary>
        private void miNeuesSpiel_Click(object sender, EventArgs e)
        {
            if (this.a.isRunning)
            {
                bool h = this.a.isPause;
                this.a.isPause = true;
                DialogResult res = MessageBox.Show(
                    this, "Willst du das laufende Spiel wirklich beenden?", this.Text, MessageBoxButtons.YesNo);
                this.a.isPause = h;
                if (res == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }
            }
            TSegmentBase.stopAnimation();
            this.a.stopGame();

            this.Display.reset();
            this.Data.reset();
            this.a = new TArena(this.Display, this.Data);
            this.Segment.registerArena(this.a);
            this.myArena = new TVisualArena(a, this.paTetris, this.Data, this.Segment);
            this.paTetris.Refresh();
            this.paNext.Refresh();
        }
Пример #2
0
 /// <summary>
 /// Wird aufgerufen, wenn das Fenster geschlossen wird
 /// </summary>
 private void foMain_FormClosed(object sender, FormClosedEventArgs e)
 {
     TSegmentBase.stopAnimation();
     this.a.stopGame();
 }