private void btnResume_Click(object sender, EventArgs e) { TetrisBox1.Resume(); btnPause.Enabled = true; btnResume.Enabled = false; TetrisBox1.Focus(); }
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(); } }
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(); }
private void btnStop_Click(object sender, EventArgs e) { TetrisBox1.StopGame(); GameStopped(); }
private void tbrSpeed_Scroll(object sender, EventArgs e) { TetrisBox1.TimerInterval = tbrSpeed.Value; TetrisBox1.Focus(); }