void gameClassMoveFunction() { List <GameObject> gameClassList = spriteControlObjectScript.getListGameClass(); //if (managerScript.Get_friendSprOn() == false) { //Debug.Log ("Workin'"); ownLoseScript_Call.SpriteEnlarge(); for (int i = 0; i < gameClassList.Count; i++) { Vector3 newPosition = gameClassList [i].transform.position; float distance = playerObject.transform.position.x + gameClassList [i].transform.position.x; if (distance > 0) { newPosition.x += moveAwayDistance; } else { newPosition.x -= moveAwayDistance; } //For the Lose Script, since they share a similar function //If the friend sprite is on, the player starts to lose. if (managerScript.Get_friendSprOn()) { ownLoseScript_Call.LoseCountdownFunction(); } gameClassList [i].transform.position = newPosition; } //} }
//New score func that checks on the arrow type now public void IncreaseScore(ARROW_TYPE arrowEnum) { if (friendSprOn == false && nameOfLevel == LEVEL_2D_NAMES.STAGE_1) { Score++; //callSprScr.IdleInvoker (); callSprScr.IdleInvoker_Friend(); } else if (friendSprOn == true && nameOfLevel == LEVEL_2D_NAMES.STAGE_1) { if (arrowEnum == ARROW_TYPE.FRIEND) { Score++; //Some lazy code for the arrow to disappear, Sorry Garrah. arrowObj.GetComponent <SpriteRenderer> ().color -= new Color(0, 0, 0, 0.2f); //Due to the fact that this implicitly implies it is stage one, //It calls the particle effect. callSprScr.ActivateParticleEffect(); //Makes it so that the game over timer doesn't tick down. friendHit = true; } //The actual tick down timer. else if (arrowEnum == ARROW_TYPE.CLASS) { if (friendHit == false) { loseScriptCall.LoseCountdownFunction(); } } //callSprScr.IdleInvoker (); callSprScr.IdleInvoker_Friend(); } arrowScr.disableArrow(); if (nameOfLevel == LEVEL_2D_NAMES.STAGE_1) { arrowScrFrd.disableArrow(); } if (nameOfLevel == LEVEL_2D_NAMES.STAGE_2) { Score++; callSprScr.IdleInvoker(); } }