More Information

The Ultimate Guide to 2D Puzzle Games with Godot

Build Four Puzzle Games with GDScript: Sokoban, 2048, Sliding Tiles and Pipe Connections
by Patrick Felicia

Book Description

Build Four 2D Puzzle Games with Godot

Learn to create four playable 2D puzzle games with Godot and GDScript, step by step. Discover how to build grids, manage game state, implement puzzle rules, and turn your ideas into interactive games.

Through practical projects, you will create Sokoban, a 2048-style merging game, a sliding tile puzzle, and a pipe connection puzzle.

What You Will Learn

  • Create Godot projects, scenes, grid-based interfaces, and reusable scripts.
  • Represent puzzle boards, tiles, and game states using GDScript.
  • Handle keyboard and mouse input, tile movement, and player interactions.
  • Implement crate pushing, walls, goals, undo, and multiple levels.
  • Build numbered-tile movement, merging, scoring, and game-over checks.
  • Shuffle solvable sliding puzzles, track moves and time, and provide hints.
  • Rotate pipe tiles, check connections, and detect completed paths.
  • Add menus, restart controls, completion feedback, and level progression.

Build Four Complete Puzzle Projects

  • Chapter 1 - Sokoban: Move a player around a grid, push crates onto goals, prevent illegal moves, implement undo and restart, and build a level-selection menu.
  • Chapter 2 - 2048-Style Merging: Move and merge numbered tiles, calculate scores, spawn new tiles, detect wins and losses, and add game controls.
  • Chapter 3 - Sliding Tile Puzzle: Slide numbered tiles into an empty space, create solvable shuffles, track time and moves, add difficulty settings, and provide visual hints.
  • Chapter 4 - Pipe Connection Puzzle: Rotate straight and corner pipes, validate connected paths, load predefined levels, and add feedback and progression.

Learn by Building

Instead of learning Godot features in isolation, you will apply them to progressively developed projects. Each chapter guides you through a game from its initial interface to a playable result, with explanations, tests, and opportunities to extend what you build.

By the end of the book, you will have practical experience creating four different 2D puzzle games and reusable techniques for your own Godot projects.

Start building puzzle games with Godot today!

Reviews