/// <summary> /// checks board for clears of rows and returns the amount of lines cleared. Calls clear line to clear the lines manually /// able to be optimized by checking if the next three lines below the line being cleared are able to be cleared. instead of calling clear line 3 times. /// </summary> /// <returns></returns> public void CheckLineClears() { var linesCleared = 0; for (var i = 19; i >= 0; i--) { var isClear = true; for (var j = 0; j < 10; j++) { if (isClear && _Board[i, j] != 1) { isClear = false; } } if (!isClear) { continue; } linesCleared++; ClearLine(i); i++; } ScoreAndStatistics.UpdateScore(linesCleared); }
public void TitleScreen() { while (_Key.Key != ConsoleKey.Enter) { if (TickCount - _lastTick < 60) { continue; } GetKeyPress(); PrintTitleScreen(); _lastTick = TickCount; } _dropTimer = TickCount; ScoreAndStatistics.SetScoreAndStats(); _CurrentPiece = NewPiece(); _NextPiece = NewPiece(); Start(); }