Exemple #1
0
 private void btnResume_Click(object sender, EventArgs e)
 {
     TetrisBox1.Resume();
     btnPause.Enabled  = true;
     btnResume.Enabled = false;
     TetrisBox1.Focus();
 }
Exemple #2
0
        private void TetrisBox1_NewBlock(object sender, TetrisBox.NewBlockEventArgs e)
        {
            lstEvents.Items.Add("NewBlock [BlockType=" + e.BlockType.ToString() + ", NextBlockType=" + e.NextBlockType.ToString() + "]");
            _newBlocksNumber += 1;
            if (chkRandomBlock.Checked && _newBlocksNumber % numRandomBlock.Value == 0m)
            {
                TetrisBox1.AddRandomBlock();
            }

            if (chkUncompleteLine.Checked && _newBlocksNumber % numUncompleteLine.Value == 0m)
            {
                TetrisBox1.AddUncompleteRow();
            }
        }
Exemple #3
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     btnStart.Enabled        = false;
     btnStop.Enabled         = true;
     btnPause.Enabled        = true;
     gbxBackground.Enabled   = false;
     gbxBlockColors.Enabled  = false;
     gbxBoardSize.Enabled    = false;
     gbxDifficulties.Enabled = false;
     gbxKeys.Enabled         = false;
     _newBlocksNumber        = 0;
     TetrisBox1.StartGame();
     TetrisBox1.Focus();
 }
Exemple #4
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     TetrisBox1.StopGame();
     GameStopped();
 }
Exemple #5
0
 private void tbrSpeed_Scroll(object sender, EventArgs e)
 {
     TetrisBox1.TimerInterval = tbrSpeed.Value;
     TetrisBox1.Focus();
 }