示例#1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (game.MoveDownCheck(current, canvus))
     {
         current.MoveDown();
     }
     else
     {
         if (current.isBomb)
         {
             game.Bombard(current, canvus);
         }
         else
         {
             game.FixCube(current, canvus);
             game.ClearLine(canvus, ref score);
         }
         pictureBox1.Refresh();
         current = next;
         next    = game.RandomPattern2();
         End_Paint();
         Next_Paint();
         Score_Paint();
     }
     All_Paint(pe);
 }
示例#2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (lgame.MoveDownCheck(lcurrent, lcanvus))
     {
         lcurrent.MoveDown();
     }
     else
     {
         lgame.FixCube(lcurrent, lcanvus);
         lgame.ClearLine(lcanvus, ref lscore);
         pictureBox1.Refresh();
         lcurrent = lnext;
         lnext    = lgame.RandomPattern();
         if (timer1.Enabled == true)
         {
             End_Paint();
         }
         Next_paint(pictureBox3, lnext);
         Score_Paint("左", label1, lscore);
     }
     All_paint(lpe);
     if (rgame.MoveDownCheck(rcurrent, rcanvus))
     {
         rcurrent.MoveDown();
     }
     else
     {
         rgame.FixCube(rcurrent, rcanvus);
         rgame.ClearLine(rcanvus, ref rscore);
         pictureBox2.Refresh();
         rcurrent = rnext;
         rnext    = rgame.RandomPattern();
         if (timer1.Enabled == true)
         {
             End_Paint();
         }
         Next_paint(pictureBox4, rnext);
         Score_Paint("右", label2, rscore);
     }
     All_paint(rpe);
 }
示例#3
0
 //计时器 每秒刷新一次界面
 private void timer_Tick(object sender, EventArgs e)
 {
     if (game.MoveDownCheck(current, canvus))
     {
         current.MoveDown();
     }
     else
     {
         game.FixCube(current, canvus);
         game.ClearLine(canvus, ref score);
         SendScore();
         pictureBox1.Refresh();
         current = next;
         next    = game.RandomPattern();
         Next_Paint();
         Score_Paint();
         End_Paint();
     }
     SendState();
     SendCurrent();
     All_Paint(pe);
     FriendAllPaint(pe);
 }