コード例 #1
0
 /// <summary>
 /// Handles the updating of the scores, levels and lines.  Also checks to see if the game is over
 /// I didn't want to do this but I kept getting a Cross Thread Operation when I tried other things
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ScoresTimer_Tick(object sender, EventArgs e)
 {
     scoreLbl.Text = _game.TotalScore.ToString();
     levelLbl.Text = _game.CurrentLevel.ToString();
     lineLbl.Text  = _game.TotalNumberOfLinesCleared.ToString();
     //If the game is over then Close down the playing space
     if (_gameOver)
     {
         _game.StopGame();
         Close();
     }
 }