An existing project02 / 12

Running Block Puzzle

Get a working game before examining how it is built.

Open the Block Puzzle demo. The player drags pieces onto an 8 × 8 board. Completed rows and columns are cleared; the game ends when none of the pieces fit.

Now get the game source. The course uses the public revision d1dd4e3, so examples can be checked against unchanged code. Run the commands below to start it locally. The dev:web script is defined in package.json.

git clone https://github.com/gamedevland/block-puzzle.git
cd block-puzzle
git checkout d1dd4e35b3df7d71fcc6a3eca9f5133773f51177
npm ci
npm run dev:web

Node.js 22.12+ or 24 is required. Vite prints the local address; the original configuration uses port 5173. After startup, check one move, a score change and a game restart.

Where to find the code

package.json · vite.config.tsDependencies, startup commands and build settings
game/src/configGameConfig, asset manifest and global DI
game/src/scenes/gameFSM, commands, services, domain classes and components
game/assets/jsonConfigs, layouts and reusable visual templates
The game folder contains the browser code. Vite runs from the repository root.

For the first run, use the dependencies in package-lock.json: npm ci installs the pinned package set.

npm run typecheck, npm run lint and npm run build:web check types, code style and the build. A successful build does not replace testing drag behavior in the browser.

Sources ↗

Block Puzzle · package.json↗Dependency versions and existing npm scripts.Block Puzzle · vite.config.ts↗Use of the shared Vite configuration.