Exemple #1
0
 void Form2_FormClosing(object sender, FormClosingEventArgs e)
 {
     // was interrupted
     _gameSpeedTimer.Stop();
     gameInfo.MainForm.Show();
     if (GameInfo.IsInGame)
     {
         LadderBoard.AddValid(new KeyValuePair <string, int>("Foo", _gameTetris.GetScore));
     }
     gameInfo.MainForm.GameInfo.IsInGame = false;
     gameInfo.MainForm.mainDropDownLadderStrip.PerformClick();
 }
Exemple #2
0
 // Tetris Game logic  Controller
 void gameSpeedTimer_Tick(object sender, EventArgs e)
 {
     if (!_gameTetris.PlayGame(ref _currPart))
     {
         GameInfo.IsInGame = false;
         _gameSpeedTimer.Stop();
         LadderBoard.AddValid(new KeyValuePair <string, int>("Foo", _gameTetris.GetScore));
         MessageBox.Show("You lost :(");
     }
     else
     {
         try
         {
             _scoreLabel.Text = _scoreLabel.Text.Substring(0, 7) + _gameTetris.GetScore.ToString();
         }
         catch
         {
             _scoreLabel.Text = "end";
         }
     }
 }