Description

Welcome to my comprehensive guide on building your very own Wordle game using Godot 4 and GDScript! If you’re passionate about game development and love puzz…

Godot version: 4.3 (dev beta) Final Project: GitHub - wojciech-bilicki/WordleTutorial

📝 Timestamps:

00:00:00 - Intro 00:00:51 - Letter tile 00:23:27 - Rows setup 00:26:15 - Keyboard button 00:44:49 - Setting up the keyboard 01:01:11 - Keyboard signals 01:12:03 - Rows Controller 01:33:52 - Applying the validation results 01:49:46 - Results UI. Bug fixing

My Notes

Final result: 00:05

UI Layout

  • Letter Tiles 00:46
  • 01:58: Setting up main node
  • 02:26 Set up clear color
  • 04:27: Rows (VBoxContainer)
  • 04:46 Row (HBoxContainer) Scene
  • 05:27 LetterTile (Panel)
    • 06:32: Label
      • Adding colors for the letter tiles.
        • We’ll be using an enum to hold the different letter tile states.
        • 07:37 These directions are out of date:
          • There is no longer a Autoload tab at the top of Project Settings. It looks like it has been moved to Project Settings Global. See docs here.
        • 10:08 Theming the letter tiles to match the enum state
        • 17:33 letter_tile.theme
  • 23:12Row:
  • 26:14 Keyboard:
  • 32:36: keyboard_button.gd
  • 45:03: Wordpool:
  • 53:30: special_button.gd
  • 55:46: Backspace button
    • How to add assets to your project 32:36: keyboard_button.gd
  • 45:03: Wordpool:
  • 53:30: special_button.gd
  • 55:46: Backspace button
    • How to add assets to your project
    • 57:02: Displaying an image in a TextureButton
  • 58:42: Laying out the entire keyboard:

Signals 1:01:04

  • see signals in Godot
  • 1:03:50: Connecting signal from UI Keyboard buttons to Keyboard controller
  • 1:07:33: Connect Keyboard to parent
  • 1:12:03: Rows controller
    • 1:15:23: Implement on_keyboard_letter_pressed(letter)
    • 1:17:11: Implement _on_keyboard_backspace_pressed()
    • 1:18 :38: Implement _on_keyboard_enter_pressed()
    • 1:19:39: ValidationAlert panel node
    • 1:23:26: validate_lenght()
    • 1:25:22: ValidationAlert script

Validation Results

  • In this section we will tackle how to update the UI of our ResultGrid (rows) when the word is found.
    • We need to mark the tiles as wrong, correct right placement etc.
  • 1:33:50: on_valid_word
  • 1:36:26: validate_word(word_to_check: String, letters: Array[LetterTile]) -> Array[Enums.State]:
  • 1:45:17: Update the state for the keyboard
    • 1:45:42: implement on_letters_validated(used_letters, validation_result):
      • 1:47:50: Explanation: We’re iterating over all the keys in the keyboard and updating the model for each.

Handling when the user wins or loses a game 1:49:40

  • In rows_controller.gd implement on_win() and on_lose()
  • 1:51:03: Figure out if the player won or lost in on_word_valid():
  • 1:52:23: 🤣 “I will be demonitized”.

1:55:01 UI Element to let player know they won or lost

  • Connect play again button: 2:01:24
  • Implement func show_results(hasWon: bool, word: String, number_of_moves: int):