/*时钟*/
 private void tmr1_Tick(object sender, EventArgs e)
 {
     if (m_canvas.Run() == true)
     {
         //pictureBox1.Refresh();
         Draw();
         DrawNext();
         label2.Text = (Convert.ToInt32(userScore) + m_canvas.m_score).ToString();
         if (m_canvas.m_score > oldScore)
         {
             getScoreToSend("我得一分啦!", "[系统提示]恭喜您获得一分");
         }
         oldScore = m_canvas.m_score;
     }
     else
     {
         tmr1.Enabled = false;
         stopWatch.Stop();          //游戏结束,停止计时
         try
         {
             teris.UpdateScore(username, Convert.ToInt32(label2.Text.Trim()));
         }
         catch
         {
             MessageBox.Show("掉线啦!");
         }
         OverForm f2 = new OverForm(m_canvas.m_score);
         f2.ShowDialog();
     }
 }
Esempio n. 2
0
 /*时钟*/
 private void tmr1_Tick(object sender, EventArgs e)
 {
     if (m_canvas.Run() == true)
     {
         //pictureBox1.Refresh();
         Draw();
         DrawNext();
         label2.Text = (Convert.ToInt32(userScore) + m_canvas.m_score).ToString();
     }
     else
     {
         btnDiffculity.Enabled = false;
         btnSimple.Enabled     = false;
         Btn_Stop.Enabled      = false;
         tmr1.Enabled          = false;
         stopWatch.Stop();          //游戏结束,停止计时
         try
         {
             teris.UpdateScore(username, Convert.ToInt32(label2.Text.Trim()));
         }
         catch
         {
             MessageBox.Show("掉线啦!");
         }
         OverForm f2 = new OverForm(m_canvas.m_score);
         f2.ShowDialog();
     }
 }