Beispiel #1
0
 public void Start()
 {
     isRunning = GenerateNextTetromino();
     if (isRunning)
     {
         gravity.Start();
         OnTetrominoStateChanged?.Invoke(fallingTetromino);
         OnBoardStateChanged?.Invoke(board);
     }
 }
Beispiel #2
0
        private void TetrominoLanded()
        {
            board.AddTetromino(fallingTetromino);
            board.RemoveFullRows(fallingTetromino.Position.y, fallingTetromino.BoundingBox.height);
            OnBoardStateChanged?.Invoke(board);
            bool tetrominoAdded = GenerateNextTetromino();

            if (tetrominoAdded)
            {
                gravity.Reset();
                OnTetrominoStateChanged?.Invoke(fallingTetromino);
            }
            else
            {
                Stop();
            }
        }