public void Update() { //inputManager.Update(); touchKeyboard.Update(); char pressedKey = touchKeyboard.GetPressedKey(); if (currentEntryStage == EntryStage.CATEGORY) { if (pressedKey != ' ') { category += pressedKey; } } if (currentEntryStage == EntryStage.WORD) { if (pressedKey != ' ' && word.Length < 30) { word += pressedKey; } } EraseLastCharFunction(); ClearWordFunction(); AddSpaceFunction(); if (InputManager.MouseRec().Intersects(saveButton.buttonRec()) && InputManager.MouseClick() == true) { if (currentEntryStage == EntryStage.CATEGORY) { currentEntryStage = EntryStage.WORD; } if (currentEntryStage == EntryStage.WORD) { if (isTwoPlayer == false) { AddWord(); Reset(); } GetOutputString(); isPlayButtonPressed = true; currentEntryStage = EntryStage.EXIT; } } if (currentEntryStage == EntryStage.EXIT && isTwoPlayer == false) { currentEntryStage = EntryStage.WORD; Reset(); } if (InputManager.MouseRec().Intersects(backButton.buttonRec()) && InputManager.MouseClick()) { isBackButtonPressed = true; } }
public void Reset() { currentEntryStage = EntryStage.WORD; category = ""; word = ""; }