DEVELOPER NOTES

Game engine and testing

The repository contains two related but separate implementations: a TypeScript browser game and a native-C 3DS port.

Web implementation and 3DS implementation headings refer to code and tests in those respective project folders; they do not imply shared engine code.

Browser rules engine Web only

The web game's engine is platform-independent TypeScript. It uses deterministic 60 Hz ticks and seeded random numbers. A run can be reproduced from its seed and input log. The engine is separated from rendering so tests can inspect board state without a browser canvas.

The standard ruleset pipeline is:

piece source → settle → transform → match → expand → clear → settle again

Rulesets select their own piece source, matcher, gravity model, transform, clear expansion, attack behavior, and objective. Gravity variants include row-shift, cascade, paired, bonded, and sticky. The replay helpers can reconstruct runs and compare state hashes.

Web project map Web only

Native C implementation 3DS only

The 3DS port maintains a separate platform-independent C gameplay library in 3DS-Port-v2/src/game.c and game.h, plus Warehouse rules in warehouse.c. The hardware app in main.c handles Citro2D/Citro3D rendering, screen input/touch, save data, and CSND audio. Campaign routes and simplified mode mechanics are implemented in that C code; it does not link the web TypeScript engine.

Tests and build checks

Web project Web only

npm test
npm run build
npm run verify
npm run rooms

npm test runs unit tests. npm run verify builds and drives the game headlessly with Playwright, validates assets and pixel output, and captures screenshots. npm run rooms checks the Warehouse solutions and can search for shortest solutions.

3DS port 3DS only

cmake -S . -B build-host
cmake --build build-host
ctest --test-dir build-host --output-on-failure

The CMake host build runs the native gameplay tests without 3DS hardware libraries. A devkitPro cross-build produces CIA and 3DSX deliverables.

Development-only behaviors

Web only The browser project contains a developer mode activated by a title-screen cheat sequence. It can win levels from the map or pause menu and is intended for testing, not ordinary play.

3DS only The native port includes hidden input chords for resetting save data from the title and immediately winning a level. They are intentionally not presented as normal gameplay controls. See Controls and menus.

Feature accuracy note

This wiki describes implemented behavior at the time it was written, based on the repository README and source. The Web and 3DS editions evolve independently; when a behavior matters for a specific build, check that edition's source and run its tests.