private void HandleReefSpawning() { float lastReefXPosition = reefList[reefList.Count - 1].GetXPosition(); if (lastReefXPosition < MyGlobals.SPAWN_X_POSITION - MyGlobals.REEF_DIMENSION * 0.75) { int randomReefPipeHeight = Random.Range(1, REEF_PIPE_MAX_HEIGHT + 1); HandleReef.CreateReef(MyGlobals.SPAWN_X_POSITION, -MyGlobals.CAMERA_ORTHO_SIZE, reefList, randomReefPipeHeight); } }
private void Awake() { instance = this; // speed birdSpeed = 30f; // List of objects pipeList = new List <HandlePipe.Pipe>(); reefList = new List <HandleReef.Reef>(); HandleReef.CreateInitialReef(-MyGlobals.CAMERA_ORTHO_SIZE, reefList); speedRingList = new List <HandleSpeedRing.SpeedRing>(); garbageList = new List <HandleObstacles.Garbage>(); questionBlobList = new List <HandleQuestionBlob.QuestionBlob>(); hasJustStarted = true; //difficulty SetDifficulty(Difficulty.Easy); pipeSpawnTimerMax = 1.2f; // state stateControllerScript = GameObject.Find("StateController").GetComponent <StateController>(); birdScript = GameObject.Find("Bird").GetComponent <Bird>(); }