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
| Name | Type | Description |
|---|---|---|
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. |
level | number | 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);playingWhat it prints (run when this page was built)