Karakuri documentation
Karakuri からくり — Physics and hyper-casual puzzle games
Play eight native puzzles, run bounded searches, step deterministic physics and mount a canvas player controlled by pointer or keyboard.
Install
npm install @johnmorrisdotca/karakuri
Start here
Entry points
| Import it | What it is | Size |
|---|---|---|
@johnmorrisdotca/Deterministic 2D physics · 53 exports | 5.0 kB | |
@johnmorrisdotca/Native level collections · 14 exports | 4.4 kB | |
@johnmorrisdotca/Controllers and canvas player · 19 exports | 40.0 kB | |
@johnmorrisdotca/Puzzle board element · 4 exports | 42.1 kB | |
@johnmorrisdotca/Register puzzle boards · 4 exports | 42.1 kB | |
@johnmorrisdotca/Eight puzzle-rule namespaces · 20 exports | 19.0 kB |
Guides
How-to
- Play blocks, tubes and screwsKeep each puzzle’s native state, legal action and solver result distinct.
- Step pin and rope puzzlesUse native mutable simulation state and fixed steps rather than wall-clock time.
- Draw a shield or stretch an armUse native path coordinates, geometry limits and stored level plans.
- Play the three-stage storiesKeep tool indices, retry and stage state in the native rule namespace.
- Interpret native search resultsKeep null, empty solutions and exhausted budgets distinct.
- Mount controllers and embed a puzzleUse native coordinates, lifecycle callbacks and cleanup.
Explanation
- Step the deterministic physics coreKeep insertion order, fixed time steps and native world geometry stable.
- How rules, physics and the player fit togetherPreserved source tree and the shared controller boundary.