Пример #1
0
 public Tetromino(PositionInfo topLeft, TetrominoShapeType shapeType, Brush color = null)
 {
     this.topLeft       = topLeft;
     this.shapeType     = shapeType;
     this.brush         = color != null ? color : TetrominoBrushesCache.GetBrushByShapeType(shapeType);
     this.bodyMatrix    = TetrominoPositionMatricesCache.GetTetrominoMatrix(shapeType);
     this.bodyPositions = GetPositions(this.topLeft, this.bodyMatrix);
 }
Пример #2
0
        private void DropNewTetromino()
        {
            if (this.TryDropNewTetromino())
            {
                TetrominoMover.UpdateField(this.fallingTetromino, this.playfieldInfo.FieldMatrix);

                this.renderer.RenderGameField();
                this.renderer.RenderNextShape(TetrominoPositionMatricesCache.GetTetrominoMatrix(this.nextTetromino.ShapeType), this.nextTetromino.Brush);
            }
            else
            {
                this.EndGame();
            }
        }