/*Function: StartNewGame * Purpose: To do setup for a new game * * arguments: none * * Description: Setup the game to be played by first selecting a word to use. * then populating the hidden word * then loading the currentword image to the image blocks. * Set the score and the state to playing... */ private void StartNewGame() { //pickWord = true; playerGuessed = false; //guessCount = 0; wrongGuessCount = 0; //roundCount = 0; if (gameType == NEWGAMETYPE.newGame || gameType == NEWGAMETYPE.LoseGame) gameScore = 0; currentWord = GetComponent<WordLib>().GetWord(); SetHiddenWord(); if (guessedLetters.Count > 0) guessedLetters.Clear(); //if(formattedGuessedLetters.Length > 0) formattedGuessedLetters = " "; Debug.Log("CurrentWord: " + currentWord.word + " Size: " + currentWord.GetWordSize()); //Setup functions to setup initial gamestate or do testing SetGameImage(); SetGameImageActive(false); BrightenGameUI(); }
// Use this for initialization void Start() { //fix this after testing to proper start states currentMstate = MAINSTATES.menu; currentGstate = PLAYINGSTATES.playerTurn; //create memory for the gamestate containeers gameImageBlocks = new List<GameObject>(); guessedLetters = new List<char>(); currentWord = new WordLibEntry(); highScores = new List<LeaderBoardEntry>(); StartCoroutine(LoadHighScores()); CreateGameImage(); LoadGameImage(); SetGameImageActive(false); enterState = false; playAgain = PLAYAGAINFLAG.notSelected; gameType = NEWGAMETYPE.newGame; SwitchMainState(MAINSTATES.menu); //SwitchPlayingState(PLAYINGSTATES.newGame); }