Esempio n. 1
0
    public void nextQuestion()
    {
        gameState       = BWGameState.BWGameStateResetting;
        enableScrolling = false;

        if (attempts > 0)
        {
        }

        attempts = 0;
        dataManager.fetchNextQuestionData();

        numberLineMin = dataManager.numberLineMin;
        numberLineMax = dataManager.numberLineMax;
        initialNumber = dataManager.initialNumber;
        numberToFind  = dataManager.numberToFind;

        string numberimg = string.Format("BW_NumberLine/Sprites/Referent/Referant_numbers{0}", AGGameState.modInt(numberToFind));

        bubbleNumber.renderer.material.mainTexture = (Texture2D)Resources.Load(numberimg);

        if (numberToFind < 0)
        {
            bubbleSymbol.SetActive(true);
        }
        else
        {
            bubbleSymbol.SetActive(false);
        }
        //bubbleNumber.text = string.Format("{0}", numberToFind);

        //flowersLayer.transform.position = new Vector3(-640, -300, -200);

        BWFlowersLayer layer = flowersLayer.GetComponent <BWFlowersLayer>();

        layer.setFlowersLayer(numberLineMin, numberLineMax, initialNumber);

        if ((numberLineMax - numberLineMin) > 7)
        {
            enableScrolling = true;
            xvel            = 0;
            lasty           = 0;
            direction       = BounceDirection.BounceDirectionStayingStill;
        }

        flowerLayerToInitialNumber(initialNumber);

        beeToSky();

        touchEnabled = true;

        playInstructionSound();

        CancelInvoke("noInteraction");
        Invoke("noInteraction", BWConstants.idleTime + 5.0f);
    }
Esempio n. 2
0
    public void nextQuestion()
    {
        enableScrolling = false;
        isDragging      = false;
        isSwiping       = false;
        prevFlower      = null;

        if (attempts > 0)
        {
        }

        attempts = 0;
        dataManager.fetchNextQuestionData();

        numberLineMin    = dataManager.numberLineMin;
        numberLineMax    = dataManager.numberLineMax;
        initialNumber    = dataManager.initialNumber;
        numberToFind     = dataManager.numberToFind;
        beeStartingPoint = dataManager.beeStartingIndex;


        string numberimg = string.Format("BW_NumberLine/Sprites/Referent/Referant_numbers{0}", AGGameState.modInt(numberToFind));

        bubbleNumber.renderer.material.mainTexture = (Texture2D)Resources.Load(numberimg);

        if (numberToFind < 0)
        {
            bubbleSymbol.renderer.material.mainTexture = (Texture2D)Resources.Load("BW_NumberLine/Sprites/Referent/Referant_exporterminus");
        }
        else
        {
            bubbleSymbol.renderer.material.mainTexture = (Texture2D)Resources.Load("BW_NumberLine/Sprites/Referent/Referant_exporterPlus");
        }

        flowersLayer.transform.position = new Vector3(BWConstants.flowersLayerMinX, -350, -200);

        BWFlowersLayer layer = flowersLayer.GetComponent <BWFlowersLayer>();

        layer.setDiagonalFlowersLayer(numberLineMin, numberLineMax, initialNumber);

        if ((numberLineMax - numberLineMin) > BWConstants.numbersOnScreen)
        {
            enableScrolling = true;
            xvel            = 0;
            lasty           = 0;
            direction       = BounceDirection.BounceDirectionStayingStill;
        }

        BWBee beeObj = bee.GetComponent <BWBee>();

        beeObj.flipBee(dataManager.shouldFlipBee);

        flowerLayerToInitialNumber(initialNumber);
        beeToFlower(beeStartingPoint);
        setExpectedNumbers(beeStartingPoint, numberToFind);

        if (dataManager.currentLevel == 0)
        {
            Invoke("levelZeroTutorial", 3);
        }
        else
        {
            playInstructionSound();
        }

        CancelInvoke("noInteraction");
        Invoke("noInteraction", BWConstants.idleTime + 5.0f);

        touchEnabled = true;
    }