Unity: Create Your Own Wordle in under 24 Hours

Prerequisites

  • Datele — a spin-off where you need to guess a date instead of a word
  • Categorle — a variant where you need to guess a word 4–7 letters long in a given category

Part 1. Planning

  • Only 1 word to guess per day
  • Each cell has to be filled with a letter
  • It must be an existing word from a predefined list
  • 6 tries to guess the correct word
  • After a user submits a word each cell and corresponding letter control should change its color to either gray, yellow or green.
  • Statistics of guesses are displayed after the game ends.
  • “timer” that will make sure only one word per day can be played
  • state to keep statistics between different sessions
  • “dictionary” with words of choice
  • a connection between the cells on the game field and the letter controls

Part 2. Scene preparation

Part 3. General implementation

  • Receive a letter
  • Remove a letter
  • Validate the input
  • Check if the input is a correct answer
Single LetterControl object
Enter button
Backspace button

Part 4. Input validation

  • Given character is not found in the answer word — then the cell and the input control should turn grey.
  • Given character is found in the answer word and it is in the correct position — then the cell and the input control should turn green.
  • Given character is found in the answer word but on the wrong position — then the cell and the input control should turn yellow unless:
    – input control was previously marked green — then it shouldn’t change to yellow
    – given character is duplicated in input but only one character exists in the answer — then only the first character should be marked yellow and all the subsequent ones should be grey. The input control should be yellow. Example: input word is sweep, answer word is earth, then the first e will be yellow while the second e should be grey.
    – given character appears in the input more times than in the correct answer word AND all the correct spots are already taken — then the extra input character should be grey. The input control should be green.
    Example: input word is daddy, answer word is dawds, then the first and the third d should be green and the second d should be grey.

Part 5. Statistics and state handling

  • player guessed the word:
    – successes count should be incremented
    – count for the line of the guess should be incremented
    – current streak should be incremented
    – max streak should be updated, if it is higher that the previous one
  • player failed to guess the word:
    – failures count should be incremented
    – current streak should be set to 0
Successful guess
Failed guess

Afterwards

  • Datele — a spin-off where you need to guess a date instead of a word
  • Categorle — a variant where you need to guess a word 4–7 letters long in a given category

Support

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store