// Use this for initialization void Start() { #region LoadWords ArtText = (TextAsset)Resources.Load("Art"); BathroomText = (TextAsset)Resources.Load("Bathroom") as TextAsset; ClothingText = (TextAsset)Resources.Load("Clothing") as TextAsset; ComputerText = (TextAsset)Resources.Load("Computer") as TextAsset; FarmText = (TextAsset)Resources.Load("Farm") as TextAsset; FlowersText = (TextAsset)Resources.Load("Flowers") as TextAsset; FoodText = (TextAsset)Resources.Load("Food") as TextAsset; HumanBodyText = (TextAsset)Resources.Load("Human Body") as TextAsset; JobsText = (TextAsset)Resources.Load("Jobs") as TextAsset; MoneyText = (TextAsset)Resources.Load("Money") as TextAsset; OfficeText = (TextAsset)Resources.Load("Office") as TextAsset; PublicBuildingsText = (TextAsset)Resources.Load("Public Buildings") as TextAsset; SchoolText = (TextAsset)Resources.Load("School") as TextAsset; SportsText = (TextAsset)Resources.Load("Sports") as TextAsset; WeatherText = (TextAsset)Resources.Load("Weather") as TextAsset; WordLists = new List<List<string>>(); Art = new List<string>(); Art = CreateWordList(ArtText.text); WordLists.Add(Art); Bathroom = new List<string>(); Bathroom = CreateWordList(BathroomText.text); WordLists.Add(Bathroom); Clothing = new List<string>(); Clothing = CreateWordList(ClothingText.text); WordLists.Add(Clothing); Computer = new List<string>(); Computer = CreateWordList(ComputerText.text); WordLists.Add(Computer); Farm = new List<string>(); Farm = CreateWordList(FarmText.text); WordLists.Add(Farm); Flowers = new List<string>(); Flowers = CreateWordList(FlowersText.text); WordLists.Add(Flowers); Food = new List<string>(); Food = CreateWordList(FoodText.text); WordLists.Add(Food); HumanBody = new List<string>(); HumanBody = CreateWordList(HumanBodyText.text); WordLists.Add(HumanBody); Jobs = new List<string>(); Jobs = CreateWordList(JobsText.text); WordLists.Add(Jobs); Money = new List<string>(); Money = CreateWordList(MoneyText.text); WordLists.Add(Money); Office = new List<string>(); Office = CreateWordList(OfficeText.text); WordLists.Add(Office); PublicBuildings = new List<string>(); PublicBuildings = CreateWordList(PublicBuildingsText.text); WordLists.Add(PublicBuildings); School = new List<string>(); School = CreateWordList(SchoolText.text); WordLists.Add(School); Sports = new List<string>(); Sports = CreateWordList(SportsText.text); WordLists.Add(Sports); Weather = new List<string>(); Weather = CreateWordList(WeatherText.text); WordLists.Add(Weather); #endregion gameStart = false; roundStart = false; isWordLoaded = false; isWordListLoaded = false; comboTime = 30.0f; pauseGame = false; currentRound = 1; totalRound = 3; currentWord = ""; currentWordList = 0; hitBoxes = new List<GameObject>(); options = GameObject.Find("Options").GetComponent<Options>(); waitActive = false; changeWord = false; missingVowel = "_"; usedWords = new List<string>(); timeSinceLastWord = 0; isStreak = false; roundLoadScreen = 3; isRoundLoading = false; battleMode = true; if (GameObject.Find("GameLogic")) { GameObject.Find("GameLogic").GetComponent<Battle>().roundStart = true; GameObject.Find("GameLogic").GetComponent<Battle>().isRoundLoading = false; Destroy(gameObject); } else { gameObject.name = "GameLogic"; } if (player == null) { player = GameObject.Find("Player").GetComponent<VowellessPlayer>(); } if (participant == null) { participant = GameObject.Find("Participant").GetComponent<VowellessPlayer>(); } }
// Use this for initialization void Start() { waitActive = false; startBattle = false; startFight = false; allowChange = true; hit = false; subtract1 = false; subtract2 = false; shakeScreen = false; screenPos = backGround.transform.position; leftOrRight = false; battleTextSize = 60; foreach(GameObject player in GameObject.FindGameObjectsWithTag("Player")) { if (player1 == null) { player1 = player.GetComponent<VowellessPlayer>(); } else if (player2 == null) { player2 = player.GetComponent<VowellessPlayer>(); } } player1Attack = player1.attack / 3; player2Attack = player2.attack / 3; }
// Use this for initialization void Start() { #region LoadWords AnimalsText = (TextAsset)Resources.Load("Animals"); ArtText = (TextAsset)Resources.Load("Art"); BathroomText = (TextAsset)Resources.Load("Bathroom") as TextAsset; ClothingText = (TextAsset)Resources.Load("Clothing") as TextAsset; ComputerText = (TextAsset)Resources.Load("Computer") as TextAsset; FarmText = (TextAsset)Resources.Load("Farm") as TextAsset; FlowersText = (TextAsset)Resources.Load("Flowers") as TextAsset; FoodText = (TextAsset)Resources.Load("Food") as TextAsset; HumanBodyText = (TextAsset)Resources.Load("Human Body") as TextAsset; JobsText = (TextAsset)Resources.Load("Jobs") as TextAsset; MoneyText = (TextAsset)Resources.Load("Money") as TextAsset; OfficeText = (TextAsset)Resources.Load("Office") as TextAsset; SchoolText = (TextAsset)Resources.Load("School") as TextAsset; SportsText = (TextAsset)Resources.Load("Sports") as TextAsset; WeatherText = (TextAsset)Resources.Load("Weather") as TextAsset; WordLists = new List<List<string>>(); Animals = new List<string>(); Animals = CreateWordList(AnimalsText.text); WordLists.Add(Animals); Art = new List<string>(); Art = CreateWordList(ArtText.text); WordLists.Add(Art); Bathroom = new List<string>(); Bathroom = CreateWordList(BathroomText.text); WordLists.Add(Bathroom); Clothing = new List<string>(); Clothing = CreateWordList(ClothingText.text); WordLists.Add(Clothing); Computer = new List<string>(); Computer = CreateWordList(ComputerText.text); WordLists.Add(Computer); Farm = new List<string>(); Farm = CreateWordList(FarmText.text); WordLists.Add(Farm); Flowers = new List<string>(); Flowers = CreateWordList(FlowersText.text); WordLists.Add(Flowers); Food = new List<string>(); Food = CreateWordList(FoodText.text); WordLists.Add(Food); HumanBody = new List<string>(); HumanBody = CreateWordList(HumanBodyText.text); WordLists.Add(HumanBody); Jobs = new List<string>(); Jobs = CreateWordList(JobsText.text); WordLists.Add(Jobs); Money = new List<string>(); Money = CreateWordList(MoneyText.text); WordLists.Add(Money); Office = new List<string>(); Office = CreateWordList(OfficeText.text); WordLists.Add(Office); School = new List<string>(); School = CreateWordList(SchoolText.text); WordLists.Add(School); Sports = new List<string>(); Sports = CreateWordList(SportsText.text); WordLists.Add(Sports); Weather = new List<string>(); Weather = CreateWordList(WeatherText.text); WordLists.Add(Weather); #endregion gameStart = true; roundStart = false; isWordLoaded = false; isWordListLoaded = false; comboTime = 5.0f; pauseGame = false; currentRound = 1; totalRound = 3; currentWord = ""; currentWordList = 0; hitBoxes = new List<GameObject>(); options = GameObject.Find("Options").GetComponent<Options>(); waitActive = false; changeWord = false; missingVowel = "_"; usedWords = new List<string>(); timeSinceLastWord = 0; isStreak = false; roundLoadScreen = 3; isRoundLoading = true; battleMode = true; wordBackDrop.GetComponent<SpriteRenderer>().enabled = false; timeTextSize = 60; time = false; allowChange = false; RenderVowelRow(false); strikes = -1; submitButton = true; allowStrike = true; if (GameObject.Find("GameLogic")) { GameObject.Find("GameLogic").GetComponent<Battle>().roundStart = true; GameObject.Find("GameLogic").GetComponent<Battle>().isRoundLoading = false; Destroy(gameObject); } else { gameObject.name = "GameLogic"; } if (player == null) { player = GameObject.Find("Player").GetComponent<VowellessPlayer>(); } RequestBanner(); // Initialize an InterstitialAd. interstitial = new InterstitialAd("ca-app-pub-4674207084400744/2981575517"); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the interstitial with the request. interstitial.LoadAd(request); player.bestScore = PlayerPrefs.GetInt("timeless"); }