//конец игры //public void TheEndGame() //{ // bool full; // for (int x = collumns - 1; x > 0; x--) // { // full = true; // for (int y = 0; y < rows; y++) // { // if (blockControls[x, y].Background == noBrush) // return false; // } // if (full) // ; // } //} //Движение вниз public void CurrentTetraminoMoveDown() { Point currentPosition = currentTetramino.CurrentPosition; Point[] Shape = currentTetramino.CurrentShape; bool move = true; currentTetraminoErase(); foreach (Point position in Shape) { if (((int)(position.Y + currentPosition.Y) + 1) >= rows) { move = false; } else if (blockControls[((int)(position.X + currentPosition.X) + ((collumns / 3) + 1)), (int)(position.Y + currentPosition.Y) + 1].Background != noBrush) { move = false; } } if (move) { currentTetramino.moveDown(); currentTetraminoDraw(); } else { currentTetraminoDraw(); CheckRows(); currentTetramino = new Tetromino(); } }
public Board(Grid TetrisGrid) { rows = TetrisGrid.RowDefinitions.Count; collumns = TetrisGrid.ColumnDefinitions.Count; score = 0; linesFilled = 0; currentTetramino = new Tetromino(); BoardDraw(TetrisGrid); currentTetraminoDraw(); }