Exemplo n.º 1
0
    private void StartNextLevel(bool leftPlayer)
    {
        if (leftPlayer && !leftPlayerMoveCompleted)
        {
            leftPlayerMoveCompleted = true;
        }
        else if (!leftPlayer && !rightPlayerMoveCompleted)
        {
            rightPlayerMoveCompleted = true;
        }

        if ((leftPlayerMoveCompleted && rightPlayerMoveCompleted) || (leftPlayerMoveCompleted && gameOverChecker.IsRightPlayerDead()) ||
            (gameOverChecker.IsLeftPlayerDead() && rightPlayerMoveCompleted))
        {
            leftPlayerMoveCompleted  = false;
            rightPlayerMoveCompleted = false;
            mainCamera.MoveForward(levelManager.DistanceBetweenCurrentPlatforms());
            (leftBridge, rightBridge) = levelManager.NextLevel(gameOverChecker.IsLeftPlayerDead(), gameOverChecker.IsRightPlayerDead());
            leftBridgeMovement.SetBridgeBody(leftBridge, gameOverChecker.IsLeftPlayerDead());
            rightBridgeMovement.SetBridgeBody(rightBridge, gameOverChecker.IsRightPlayerDead());
        }
    }