Exemplo n.º 1
0
        public void Restart()
        {
            tetris.timer.Stop();
            tetris.lbScore.Text = "Score: 0";
            tetris.lbLevel.Text = "Level: 0";
            currentShape.RemoveFromControl(tetris);
            nextShape.RemoveFromControl(tetris);
            ClearGrid();

            currentShape = getRandomShapeCenter();
            nextShape    = getNextShape();
            currentShape.AddToControls(tetris);
            tetris.timer.Start();
        }
Exemplo n.º 2
0
 public void Start()
 {
     tetris.timer.Tick += instance.Time_Tick;
     if (Autoplay)
     {
         tetris.timer.Interval = Setting.autoGameSpeed;
     }
     else
     {
         tetris.timer.Interval = Setting.startSpeed;
     }
     tetris.KeyDown += instance.Key_Down;
     currentShape    = getRandomShapeCenter();
     nextShape       = getNextShape();
     currentShape.AddToControls(tetris);
 }