This is the second half of the main game play loop. The action phase feeds in the available letters and score multiplier. They are used to create as many words as possible within the time limit. Valid words are multiplied with the experience tokens, increasing the score to earn more money, which is then used to upgrade the player's kit for the next action phase.
With a stronger kit, the player can find a larger batch of letters and earn more experience tokens for a higher score multiplier. This process is repeated until the player finishes their run or dies.
Because targeting a letter is controlled by the Playdate's crank, all input controls are handled by the D-Pad. This keeps both of the player's hands in one place and speeds up input.
Crank: Target a letter
D-Pad Down: Select targeted letter
D-Pad Up: Remove last selected letter from word
D-Pad Right: Submit potential word
D-Pad Left: Clear all selected letters
When the word list extends past the screen, the player can toggle the crank control to scroll through that list. This shows which words were already submitted and can help with finding new words.
Separating words into different files helps with organization and error prevention, but it also helps with creating the word validation system. With this, I could create a table of trees, where a letter has a list of following letters and an indicator if it's an end of a word. When a word is submitted, each letter is checked along a tree. If the last letter has been listed as a complete word, then it's valid.
Each word also has it's own ID, so that it can only be submitted once per letter game.
A problem I found when working on the valid word dictionary was that the Playdate would crash on start-up. This was because of a loading time-out; it was taking too long to create the trees in one frame. Coroutines solved this. I implemented it into all other loading sequences while I was at it to create a loading bar.
(The loading bar is very fast here since it's from the simulator)
This is a polygon with interpolated vertex positions and a circular mask. Using a polygon gives the cleanest looking result for the area of the circle, where the mask provides the cleanest edge. The polygon is also used to invert the pixels of the number.
The goal for this was to have a timer that was easy to read at a glance, and was also efficient with space.
The letter game phase has remained mostly true to my initial design, with only a few simplifications. The center letter in the Spelling Bee design was cut, since it's hard to select something with a crank when it's not on a ring. This also helped direct what the experience should be like: less focus on the puzzle and more focus on quantity. The mindset is to chase a high score, which is a similar high-energy feeling to the action phase.