Skip to the content

Karakuriからくり

Play eight native puzzles, run bounded searches, step deterministic physics and mount a canvas player controlled by pointer or keyboard.

Karakuri is the Japanese word からくり for a mechanism or ingenious device. About the name

Contents

Reference · Controllers and canvas player

createControllerfunction

Makes a controller for level level (from 1) of a game; a level out of range is held to the nearest.

Import it

import { createController } from "@johnmorrisdotca/karakuri/play";

Definition

function createController(game: KarakuriGame, level: number): Controller

Parameters

NameTypeDescription
game"save-the-character" | "pin-rescue" | "nuts-and-bolts" | "stretch-grabber" | "grid-escape" | "rope-cut" | "tube-sort" | "choice-story"

One of the native KARAKURI_GAME_IDS.

levelnumber

The native one-based player level number, or typed level record required by the signature.

Returns

Controller

Makes a controller for level level (from 1) of a game; a level out of range is held to the nearest.

Examples

import { createController } from "@johnmorrisdotca/karakuri/play";

console.log(createController("tube-sort",1).status);
playing

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/karakuri 0.2.1.