I finished the course and was wondering how I could make a game where you spell words by selecting letter tiles. I’m not sure how I would make the program know when words are valid or not. I think I would have to link it to a dictionary or something. Does any know where I can find easy to follow instructions?
I´ve a prototype game that does something similar, I have imported an whole grammar corrector library in .txt and saved that to my game folder, I process this at the beginning of the game execution and save it to an array of strings using the split method, then I use an foreach loop whenever I want to check if the word that player typed is correct by comparing with the array. Let me know if I can help with something.
Is the grammar corrector library a list of dictionary words?
How do you process .text files in unity?
Thanks for the response, I didn’t think anyone else would find word game interesting! But if I can get unity accepting valid words I’d like to see if I could create a word game with tower defense elements! something unheard of as far as I know!
The grammar corrector library that I used was just a .txt file with over hundred of thousands of words, each one in a different line. You can use anything that the c# language has to offer and make it communicate with the engine.
Word games are interesting they have always been around, we are just using another technology to share them now.
I’ve done this way: I’ve declared an public variable of type TextAsset which is the class responsible for processing texts within unity interface (you could probably do it using raw c# code, but they have done this small interface to help us), and added it to a GameObject and then addressed the .txt file to it by dragging into the inspector, after that I’ve declared an array of strings and processed the .txt using the split method:
Array = myTextAsset.text.Split('\n');
The original file that I’ve downloaded with the library had some other information for each line/word that I didn’t need, I had to process that first using c# and saved it in a way that there was only the word per line, this made that simple split method enough to process it.