I've created a demonstration to show how you could use Vuo make a word-guess-type game. This simple game has only some of the elements of the currently popular word game, created by Josh Wardle. This demonstration:
- Doesn't check for real words. You can enter any three letters (or even non-letter characters) you choose. There isn't a list of words to check against. If you want more error-checking, you could add a check that the entry is a letter. You could also check against a list of real three-letter words, but again, this demonstration doesn't implement that.
- Uses a desktop file to hold an index, so that each time you start, a new word from the list will be presented. If you go through all the words, the list of hidden words starts over.
- Doesn't check the time. If you'd like to limit the number of times someone can play, you can use Vuo's
date-time set of nodes to fetch the current time, the time last played, and then consider elapsed time to choose what actions to take.
- Doesn't collect statistics on how you played previous games.
I started with a composition
word-guess-simple that uses the
Make Text Field node by itself. This node allows more than one letter to be entered into the text field, so if you enter more than one letter, the entry won't be trimmed until you finish editing the text (by clicking outside the text field, or pressing Return, Enter, Tab, or Esc). I'll include it in a comment, so you can see the differences. The key thing I learned is being very aware of events to the
Build List or
Process List nodes to make sure that what you want to process is ready to be processed.
word-guess-better composition uses the
Make Text Field node with
Receive Keyboard Typing and the events from
Receive Mouse Drags on Layer to limit each entry to one letter. Since
Make Text Field allows more than one letter, if you type quickly you still might see a transient second letter displayed.
The word-guess-simple composition uses two subcompositions, one to separate out a letter and one to build the 'tiles' that are used to display results. The word-guess-better uses only the build tiles subcomposition.
If you want to export a composition as a Mac app, you'll need to change where the hidden word index file is saved and retrieved from. (See https://vuo.org/comment/8391#comment-8391) for details.