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); }
void FingerGestures_OnFingerTap(int fingerIndex, Vector2 fingerPos, int tapCount) { // Debug.Log( "tapping"); if (!touchEnabled) { return; } CancelInvoke("noInteraction"); Invoke("noInteraction", BWConstants.idleTime); GameObject selection = PickObject(fingerPos); if (isSelectionFlower(selection)) { playSoundEffect("Bee_flowertap_new_01"); BWFlower flowerObj = selection.GetComponent <BWFlower>(); attempts++; if (flowerObj.getFlowerNumber() == numberToFind) { AGGameState.incrementStarCount(); CancelInvoke("noInteraction"); touchEnabled = false; flowerObj.setSelected(); beeToFlower(numberToFind); gameState = BWGameState.BWGameStateGuessed; //nextQuestion(); } else { flowerObj.setSelected(); playWrongSound(flowerObj.getFlowerNumber()); BWBee beeObj = bee.GetComponent <BWBee>(); beeObj.playNoAnimation(); } } else { BWBee beeObj = bee.GetComponent <BWBee>(); if (selection == beeObj.body || selection == bubbleNumber) { voiceOverSource.clip = null; voiceOverSource.Stop(); currentClips = new List <AudioClip>(); playInstructionSound(); beeObj.playTapAnimation(); } } }
public void destroyFlowerLayer() { //flower close anim gameState = BWGameState.BWGameStateResetting; BWFlowersLayer layerObj = flowersLayer.GetComponent<BWFlowersLayer>(); layerObj._delegate = this; layerObj.destroyFlowersLayer(); beeToSky(); //scroll reset // //flowerLayerToInitialNumber(numberLineMin); }
public void destroyFlowerLayer() { //flower close anim gameState = BWGameState.BWGameStateResetting; BWFlowersLayer layerObj = flowersLayer.GetComponent <BWFlowersLayer>(); layerObj._delegate = this; layerObj.destroyFlowersLayer(); beeToSky(); //scroll reset // }
void FingerGestures_OnFingerTap( int fingerIndex, Vector2 fingerPos, int tapCount ) { // Debug.Log( "tapping"); if(!touchEnabled) return; CancelInvoke("noInteraction"); Invoke("noInteraction", BWConstants.idleTime); GameObject selection = PickObject(fingerPos); if(isSelectionFlower(selection)) { playSoundEffect("Bee_flowertap_new_01"); BWFlower flowerObj = selection.GetComponent<BWFlower>(); attempts++; if(flowerObj.getFlowerNumber() == numberToFind) { AGGameState.incrementStarCount(); CancelInvoke("noInteraction"); touchEnabled = false; flowerObj.setSelected(); beeToFlower(numberToFind); gameState = BWGameState.BWGameStateGuessed; //nextQuestion(); } else { flowerObj.setSelected(); playWrongSound(flowerObj.getFlowerNumber()); BWBee beeObj = bee.GetComponent<BWBee>(); beeObj.playNoAnimation(); } } else { BWBee beeObj = bee.GetComponent<BWBee>(); if(selection == beeObj.body || selection == bubbleNumber) { voiceOverSource.clip = null; voiceOverSource.Stop(); currentClips = new List<AudioClip>(); playInstructionSound(); beeObj.playTapAnimation(); } } }
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); }
public void destroyCurrentLayer() { gameState = BWGameState.BWGameStateGuessed; destroyFlowerLayer(); }