Пример #1
0
    void Start()
    {
        Board board = new Board(10, 20);

        boardView.SetBoard(board);
        nextPieceView.SetBoard(board);

        game = new Game(board, new UniversalInput(new KeyboardInput(), boardView.touchInput));
        game.FinishedEvent             += OnGameFinished;
        game.PieceFinishedFallingEvent += audioPlayer.PlayPieceDropClip;
        game.PieceRotatedEvent         += audioPlayer.PlayPieceRotateClip;
        game.PieceMovedEvent           += audioPlayer.PlayPieceMoveClip;
        game.Start();

        scoreView.game = game;
        levelView.game = game;
    }
Пример #2
0
    void Start()
    {
        alertView.Hide();

        boardView.SetBoard(board);
        nextPieceView.SetBoard(board);

        input.Register(new KeyboardInput());
        input.Register(touchInput);

        game = new Game(board, input);
        game.ResumedEvent              += input.Enable;
        game.PausedEvent               += input.Disable;
        game.FinishedEvent             += OnGameFinished;
        game.PieceFinishedFallingEvent += input.Cancel;
        game.PieceFinishedFallingEvent += audioPlayer.PlayPieceDropClip;
        game.PieceRotatedEvent         += audioPlayer.PlayPieceRotateClip;
        game.PieceMovedEvent           += audioPlayer.PlayPieceMoveClip;
        game.Start();

        scoreView.game = game;
        levelView.game = game;
    }