Ejemplo n.º 1
0
        private void Weld()
        {
            for (int x = 0; x < MatrixSize.Width; x++)
            {
                for (int y = 0; y < MatrixSize.Height; y++)
                {
                    if (_tetrominoMatrix[x, y])
                    {
                        int xPosition = x + _xIncrease;
                        int yPosition = y + _yIncrease;

                        if (yPosition < 0)
                        {
                            TetrisLevel.FinishGame();
                        }
                        else
                        {
                            TetrisLevel.LevelMatrix[yPosition][xPosition] = TetrominoType;
                        }
                    }
                }
            }

            Active = false;
        }
Ejemplo n.º 2
0
        public Tetromino(TetrisLevel tetrisLevel, TetrominoType type)
        {
            TetrominoType = type;
            TetrisLevel   = tetrisLevel;
            Positions     = new List <Point>();

            CreateTetromino();

            Active = true;
        }