From 2ee7ac886aa24d6eb01b24eee0b2586c6db7f9ce Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 11 Apr 2026 23:36:34 +0700 Subject: [PATCH] feat(levels): ship the full 155-puzzle Microban set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expand the level data from the first 100 Microban layouts to the complete set, up through the two oversized finale mazes ("Take the long way home" and "The Dungeon"). Responsive tile sizing already handles the large grids — no rendering changes needed. Update credit language in README, PDR, changelog, roadmap, codebase summary, menu subtitle, and the data file header to reflect the full set. Credit for David W. Skinner's layouts remains prominent; ownership of the engine, UI, parser, and progression code stays explicit. Verified all 155 layouts parse cleanly, have a player, matching box/goal counts, and none start already solved. --- README.md | 2 +- docs/codebase-summary.md | 2 +- docs/development-roadmap.md | 2 +- docs/project-changelog.md | 5 + docs/project-overview-pdr.md | 6 +- src/game/data/microban-levels.js | 553 ++++++++++++++++++++++++++++++- src/game/scenes/menu-scene.js | 2 +- 7 files changed, 563 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ff1975d..9fb39f5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ My from-scratch Sokoban game, built with Phaser 3 and Vite. The engine, UI, leve Play: [https://tiennm99.github.io/sokoban/](https://tiennm99.github.io/sokoban/) ## Features -- **100 solvable puzzles** using level layouts from the Microban set (beginner-friendly, concept-focused). +- **All 155 puzzles** from the Microban set, from beginner teasers up to the giant "Take the long way home" maze and "The Dungeon" finale. - **Paginated level select** with progress tracking and best-move record per level. - **Controls**: arrow keys or WASD. `U` / `Z` to undo, `R` to restart, `Esc` for menu. - **Undo history**, live move counter, animated moves. diff --git a/docs/codebase-summary.md b/docs/codebase-summary.md index cd0859f..0dad45d 100644 --- a/docs/codebase-summary.md +++ b/docs/codebase-summary.md @@ -7,7 +7,7 @@ src/ └── game/ ├── main.js # Phaser Game config + scene registration ├── data/ - │ └── microban-levels.js # 100 XSB level strings + │ └── microban-levels.js # 155 XSB level strings (full Microban set) ├── core/ │ ├── level-parser.js # XSB text → {walls, targets, boxes, player, floors} │ ├── board-model.js # Pure game state + move/undo/win logic diff --git a/docs/development-roadmap.md b/docs/development-roadmap.md index 80ee02a..7c89ed9 100644 --- a/docs/development-roadmap.md +++ b/docs/development-roadmap.md @@ -6,7 +6,7 @@ - Arrow-key movement, box pushing, target detection. ## Phase 2 — Overhaul (complete, 2026-04-11) -- Replace 3 hand-crafted levels with 100 Microban levels. +- Replace 3 hand-crafted levels with the full 155-puzzle Microban set. - Modularize: core / ui / scenes split, every file <200 LOC. - BoardModel with undo + move counter. - Paginated level select (5 pages × 20 levels). diff --git a/docs/project-changelog.md b/docs/project-changelog.md index 2967386..d9e2747 100644 --- a/docs/project-changelog.md +++ b/docs/project-changelog.md @@ -1,5 +1,10 @@ # Project Changelog +## 2026-04-11 — Full Microban set + +### Changed +- Level data expanded from the first 100 Microban puzzles to the complete 155-level set, including the oversized finale mazes ("Take the long way home", "The Dungeon"). Credit language updated everywhere to match. + ## 2026-04-11 — Overhaul ### Added diff --git a/docs/project-overview-pdr.md b/docs/project-overview-pdr.md index b5e6b3b..0ffddde 100644 --- a/docs/project-overview-pdr.md +++ b/docs/project-overview-pdr.md @@ -1,11 +1,11 @@ # Sokoban — Product Development Record ## What it is -A from-scratch Sokoban implementation by tiennm99. Phaser 3 + Vite, deployed to GitHub Pages. The engine, UI, parser, and progression system are original code. Puzzle layouts come from David W. Skinner's freely distributable **Microban** set (100 of his puzzles shipped) — layouts only, no code reused from Skinner's own programs. +A from-scratch Sokoban implementation by tiennm99. Phaser 3 + Vite, deployed to GitHub Pages. The engine, UI, parser, and progression system are original code. Puzzle layouts come from David W. Skinner's freely distributable **Microban** set — the full 155-puzzle set is shipped — layouts only, no code reused from Skinner's own programs. ## Goals - Clean, beginner-friendly Sokoban that runs in any modern browser with no install. -- 100 curated puzzles, progressing from easy to moderately tricky. +- Full 155-puzzle Microban set shipped, progressing from tiny beginner teasers up to the two huge finale mazes. - Keyboard-first UX with undo, restart, move counter, persistent progress. - Small, well-organized codebase (<200 LOC per file) that's easy to extend. @@ -18,7 +18,7 @@ A from-scratch Sokoban implementation by tiennm99. Phaser 3 + Vite, deployed to Casual puzzle fans, Sokoban beginners. Microban set chosen specifically because it's designed for beginners and illustrates one concept per puzzle. ## Success criteria -- All 100 levels playable end-to-end. +- All 155 levels playable end-to-end, including the oversized finale mazes that rely on responsive tile sizing. - Progress (completion + best moves) persists across sessions. - Build output fits in the default Vite budget. - Runs smoothly on desktop browsers at 1024×768 canvas (scaled responsively). diff --git a/src/game/data/microban-levels.js b/src/game/data/microban-levels.js index 5a7f07e..f7b1c57 100644 --- a/src/game/data/microban-levels.js +++ b/src/game/data/microban-levels.js @@ -1,7 +1,8 @@ /** * Puzzle layouts from the Microban level set by David W. Skinner * (April 2000, 155 puzzles, freely distributable with credit). - * First 100 layouts shipped here — small, concept-focused puzzles. + * The full 155-layout set is shipped here — from tiny beginner puzzles + * up to the huge "Take the long way home" maze and "The Dungeon" finale. * Only the level designs are borrowed; the parser, renderer, and engine * are original code written for this project. * Source: http://users.bentonrea.com/~sasquatch/sokoban/ @@ -825,5 +826,553 @@ export const MICROBAN_LEVELS = [ #.$# # #. # $ # # # # -########` +########`, +` ##### + # # + # # ####### + # * # # + ## ## # # + # #* # +### # # # ### +# *#$+ # +# # ## ## +# # * # +####### # # + # # + #####`, +`########### +#....# # +# # $$ # +# @ ## # +# ##$ # +###### $ # + # # + ######`, +` ##### + # . ## +### $ # +# . $#@# +# #$ . # +# $ ### +## . # + #####`, +` ##### +##### # +# $ # +# $#$#@# +### # # + # ... # + ### ## + # # + ####`, +` #### #### +## ### ## +# # # # +# *. .* # +###$ $### + # @ # +###$ $### +# *. .* # +# # # # +## ### ## + #### ####`, +` ######## + # # + #@ $ # +## ###$ # +# .....### +# $ $ $ # +###### # # + # # + #####`, +`######## +# # +# $*** # +# * * # +# * * # +# ***. # +# @# +########`, +`#### ##### +# ### # ## +# # #$ $ # +#..# ##### # # +# @ # $ $ # +#..# ## +## ######### + #####`, +` ####### +# # # +# # # # # + # @ $ # +### ### # +# ### # +# $ ##.# +## $ #.# + ## $ .# +# ## $#.# +## ## #.# +### # # +### #####`, +` #### + # # + # $#### +###. . # +# $ # $ # +# . .### +####$ # + # @# + ####`, +`###### +# #### +# ...# +# ...# +###### # + # # # + # $$ ## + # @$ # + # $$ # + ## $# # + # # + ######`, +` ##### +## #### +# $$$ # +# # $ # +# $## ## +### #. # + # # # + ##### ### + # # ## + # @....# + # # + # # # + ########`, +` ##### + ## # +### # # +# . # +# ## ##### +# . . # ## +# # @ $ ### +#####. # $ # + #### $ # + ## $ ## + # ## + # # + ####`, +`###### +# ### +# # $ # +# $ @ # +## ## ##### +# #......# +# $ $ $ $ # +## ###### + #####`, +` ##### +##### #### +# # # +# #..... # +## ## # ### + #$$@$$$ # + # ### + #######`, +` ##### + ### # +####.....# +# @$$$$$ # +# # ## +##### # + #####`, +` #### #### + # ### ## + # @ # +##..### # +# # # +#...#$ # # +# ## $$ $ # +# $ ### +#### ### + ####`, +` ##### +## ## +# $ ## +# $ $ ## +###$# . ## + # # . # + ## ##. # + # @ . ## + # # # + ########`, +` ###### + # ## + ## ## # + # $$ # # + # @$ # # + # # # +#### # # +# ... ## +# ## +#######`, +` #### +####### # +# $ ## +# $##### # +# @# # # +## ##.. # +# # ..#### +# $ ### +# $### +# # +####`, +` ###### + # . # +##$.# # +# * # +# ..### +##$ # ##### +## ## # # +# #### # # +# @ $ $ # +## # # + ##########`, +`##### +# ### +# #$ # +# $ # +# $ $ # +# $# # +# @### +## ######## +# ...# +# # +########..# + ####`, +`######## +# # +# $ $$ ######## +##### @##. . # + #$ # . # + # #. . ## + #$# ## # # + # # + # ### ## + # # #### + ####`, +`############## +# # # +# $@$$ # . ..# +## ## ### ## # + # # # # + # # # # # + # ######### # + # # + #############`, +` ##### + # ## + # $ # +######## #@## +# . # $ $ # +# $# # +#...##### # +##### #####`, +` ########### +##....... # +# $$$$$$$@ # +# # # # ## +# # # # +# ####### +#####`, +`## #### +#### #### + # $ $. # +## # .$ # +# ##.### +# $ . # +# @ # # +# ###### +####`, +` ######### +### # # +# * $ . . # +# $ ## ## +####*# # + # @ ### + # ### + #####`, +` ######### +### @ # # +# * $ *.. # +# $ # # +####*# ### + # ## + # ### + #####`, +`##### ##### +# ####.. # +# $$$ # +# $# .. # +### @# ## # + # ## # + ##########`, +`##### +# # +# . # +#.@.### +##.# # +# $ # +# $ # +##$$ # + # ### + # # + ####`, +`#### +# @### +#.* ##### +#..#$$ $ # +## # + # # ## # + # ##### + #####`, +` ####### + # . .### + # . . . # +### #### # +# @$ $ # +# $$ $ # +#### ### + #####`, +` #### +######### # +# ## $ # +# $ ## # +### #. .# ## + # #. .#$## + # # # # + # @ $ # + # ####### + ####`, +`####### +# ##### +# $$#@##..# +# # # +# $ # # # +#### $ ..# + ########`, +` ####### + # # +## ###$## +#.$ @ # +# .. #$ # +#.## $ # +# #### +######`, +` #### + ## ### +#### # $ # +# #### $ $ # +# ..# #$ # +# # @ ### +## #..# ### + # ## # # + # # + ########`, +` #### +### # +# ### +# # . .# +# @ ...#### +# # # # ## +# # $$ # +##### $ $ # + ##$ # ## + # # + ######`, +` #### +## #### +# ...# +# ...# +# # ## +# #@ #### #### +##### $ ### # + # ##$ $ # + ### $$ # + # $ ## ### + # ###### + ######`, +`######## ##### +# # ### # +# ## $ # +#.# @ ## $ ## +#.# # $ ## +#.# $ ## +#. ## ##### +## # + ######`, +` ######## + # # . # + # .*.# + # # * # +####$##.## +# $ # +# $ ## $ # +# @# # +##########`, +` #### + # # + # #### +###$.$ # +# .@. # +# $.$### +#### # + # # + ####`, +`#### +# #### +# $ # +# .# # +# $# ## +# . # +#### # + # # + ### ### + # $ # +## #$# ## +# $ @ $ # +# ..#.. # +### ### + #####`, +` #### + ### ##### + # $$ # # + # $ . .$$## + # .. #. $ # +### #** . # +# . **# ### +# $ .# .. # +##$$.@. $ # + # # $$ # + ##### ### + ####`, +` ##### + # @ # + ## ## +###.$$$.### +# $...$ # +# $.#.$ # +# $...$ # +###.$$$.### + ## ## + # # + #####`, +` ####### +## . ## +# .$$$. # +# $. .$ # +#.$ @ $.# +# $. .$ # +# .$$$. # +## . ## + #######`, +` ##### +######## # +#. . @#.# +# ### # +## $ # # + # $ ##### + # $# # + ## # # + # ## + #####`, +`########### +# . # # +# #. @ # +# #..# ####### +## ## $$ $ $ # + ## # + #############`, +` #### +## ### +#@$ # +### $ # + # ###### + # $....# + # # #### + ## # # + # $# # + # # + # ### + ####`, +` #### + ##### # + # $####### +## ## ..# ...# +# $ $$#$ @ # +# ### # +####### # #### + ####`, +` #### + # # + ### # +## $ # +# # # +# #$$ ###### +# # # .# +# $ @ .# +### ####..# + #### ####`, +`###### #### +# # # +#.## #$## # +# # # # +#$ # ### # # +# # # # # +# # #### # # # +#. @ $ * . # +###############`, +`############# +#.# @# # # +#.#$$ # $ # +#.# # $# # +#.# $# # $## +#.# # $# # +#.# $# # $# +#.. # $ # +#.. # # # +############`, +` ############################ + # # + # ######################## # + # # # # + # # #################### # # + # # # # # # + # # # ################ # # # + # # # # # # # # + # # # # ############ # # # # + # # # # # # # # # + # # # # # ############ # # # + # # # # # # # # + # # # # ################ # # + # # # # # # +##$# # #################### # +#. @ # # +#############################`, +` ###### #### +#####*# ################# ## +# ### # +# ######## #### ## # +### #### # #### #### ## +#*# # .# # # # # # # +#*# # # # ## # ## ## # +### ### ### # ## # ## ## + # # #*# # # # # + # # ### ##### #### # # + ##### ##### ####### ###### + # # # #**# # +## # # #**# ####### ## # +# ######### # ##### ### +# # # $ #*# +# ######### ### @##### #*# +##### #### #### ######` ]; diff --git a/src/game/scenes/menu-scene.js b/src/game/scenes/menu-scene.js index 5c2515c..2e3e3c7 100644 --- a/src/game/scenes/menu-scene.js +++ b/src/game/scenes/menu-scene.js @@ -19,7 +19,7 @@ export default class MenuScene extends Phaser.Scene { const cy = this.cameras.main.centerY; this.add.text(cx, cy - 200, 'SOKOBAN', FONTS.title).setOrigin(0.5); - this.add.text(cx, cy - 130, '100 puzzles to solve', FONTS.subtitle).setOrigin(0.5); + this.add.text(cx, cy - 130, '155 puzzles to solve', FONTS.subtitle).setOrigin(0.5); createButton(this, cx, cy - 20, 'PLAY', () => this.scene.start('LevelScene'), { width: 240, height: 64 });