This repository contains the full source code for the “Build a Sokoban Game with Phaser Editor” YouTube course.
You’ll learn how to build a complete Sokoban-style puzzle game using Phaser 3 and Phaser Editor 2D, including tilemaps, prefabs, scene transitions, and a clean separation between game logic and rendering.
📺 Watch the full course playlist:
🎮 Play the game demo:
🕹️ Dungeon Sokoban on itch.io
Over the series, we build a small but complete Sokoban game with:
- Modular project structure
- Custom Sokoban logic written in pure JavaScript
- Tilemap-based level design
- Player, box, and goal prefabs
- Smooth fade transitions between scenes
- Multiple fully playable levels
- Clean scene flow architecture
This repository includes:
- Starting project files
- One snapshot per video (via tags)
- Completed version of the free course
- All assets used in the project
If you're following along with the series, this repo is your reference point for every step.
/assets → Images, spritesheets, fonts, and asset packs
/phaserjs_editor_scripts_base → Core script node libraries
/src
/components → Component configuration in Phaser Editor
/lib → Sokoban core engine (pure JS)
/prefabs → Reusable blocks for text and other game objects
/scenes → Boot, Preload, Title, and Level layouts & tilemap data
/scripts → Script nodes for game manager and scene transitions
/config.js → Common game code
/main.js → Game configuration and creation
/index.html → Web app entry point
This project uses Phaser Editor 2D, which includes its own development server and scene editor.
Download it here:
- Open Phaser Editor 2D
- Select File → Open Project
- Choose this repository’s folder
Click the Play button inside Phaser Editor.
You should see the title screen and be able to start Level 1.
Each lesson builds on the last.
- Introduction & Full Game Demo
- Project Overview & Architecture Explained
- Setting Up Your Project in Phaser Editor
- Creating the Title Scene
- Understanding Prefabs in Phaser Editor
- Setting Up a Boot Scene (Loading Fonts & UI Assets)
- Building the Level Layout with Tilemaps
- Creating Player & Box Prefabs
- Coding the Core Logic (Part 1)
- Coding the Core Logic (Part 2)
- Testing the Sokoban Logic Engine
- Building the Game Manager Script
- Parsing Tilemap Data for Gameplay
- Connecting Logic to Phaser
- Handling Input & Updating Sprites
- Adding More Levels to the Game
- Level Transitions & Next-Level Flow
- Final Polish & Improvements
- Wrap-Up & Next Steps
Each video has a corresponding project snapshot (via a tag).
Tags for each video:
v00-base
v03-setup
v04-main-menu
v05-prefabs
v06-boot-scene
v07-level-layout
v08-player-prefab
v09-core-logic-1
v10-core-logic-2
v12-game-manager
v13-parse-tilemap
v14-connect-logic
v15-input
v16-more-levels
v17-level-flow
v18-polish
v19-finished
To check out a snapshot:
git checkout v05-prefabsYou can download a free asset pack, full source ZIP, and per-video project bundles from Gumroad.
👉 Free download (Pay What You Want):
https://scottwestover.gumroad.com/l/sokoban-course
A premium extended course includes:
- Move counter & scoring
- Undo moves (Command Pattern)
- Animated title scene
- Sound effects & background music
- Celebration effects
- Level select scene
👉 Premium course:
https://scottwestover.gumroad.com/l/sokoban-course
- Game Engine: Phaser 3
- Editor: Phaser Editor 2D
- Course Creator: Scott Westover
- Art Assets: Included in
/assets- Press Start 2P font created by CodeMan38: https://fonts.google.com/specimen/Press+Start+2P
- Dungeon Pack and UI Pack created by Toadzillart: https://toadzillart.itch.io/
If you found this course helpful:
- ⭐ Star this repository
- 🔔 Subscribe on YouTube
- 💬 Leave a comment
- ❤️ Support the project on Gumroad
- YouTube: https://www.youtube.com/@swestover
- X/Twitter: https://x.com/_scottwestover
- Bluesky: https://bsky.app/profile/scottwestover.dev
- Linkedin: https://www.linkedin.com/in/scott-westover-77393a97
- Blog: https://scottwestover.dev


