Exemplo n.º 1
0
        /// <summary>
        /// Checks To See if you need to Clear Line(s)
        /// </summary>
        private void CheckForLineClear()
        {
            //Check to see if lines need to be cleared
            List <int> linesThatNeedToBeCleared = GetNumberOfLinesThatAreFill();

            if (linesThatNeedToBeCleared.Count > 0)
            {
                //Tell the game how many lines that are being cleared
                LineCleared?.Invoke(linesThatNeedToBeCleared.Count);
                //Draw out the falling block
                DrawOutTheBlocks(null);
                foreach (var item in linesThatNeedToBeCleared)
                {
                    for (int x = 0; x <= Properties.Settings.Default.Right_Of_Play_Area; x++)
                    {
                        _cells[x, item].BackColor = Properties.Settings.Default.Line_Clear_Color;
                    }
                }
                //Put the Game to Sleep to Show the User the lines being Cleared
                Thread.Sleep(250);
                //Clear out the lines
                ClearOutTheLines(linesThatNeedToBeCleared);
            }
        }
Exemplo n.º 2
0
 private void OnLineCleared(EventArgs e)
 {
     LineCleared?.Invoke(this, e);
 }
Exemplo n.º 3
0
 protected virtual void OnLineCleared()
 {
     LineCleared?.Invoke(this);
 }
Exemplo n.º 4
0
 public void ClearLine()
 {
     Array.Clear(_buffer, CursorY.Value * Width.Value, Width.Value);
     CursorX.Value = 0;
     LineCleared?.Invoke(this, EventArgs.Empty);
 }