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 · Deterministic 2D physics

RigLinktype

A link that keeps two nodes length apart (a rope pulls but does not push: slack links only pull).

Import it

import type { RigLink } from "@johnmorrisdotca/karakuri/physics";

Definition

interface RigLink {
    a: number;
    b: number;
    length: number;
    alive: boolean;
}

Members

NameTypeDescription
anumber
bnumber
lengthnumber
aliveboolean

Examples

import { addRope, createRig } from "@johnmorrisdotca/karakuri/physics";
import type { RigLink } from "@johnmorrisdotca/karakuri/physics";

const rig=createRig({gravity:0,iterations:1});
addRope(rig,0,0,10,0,2);
const value: RigLink = rig.links[0];
console.log(value);
{ a: 0, b: 1, length: 5, alive: true }

What it prints (run when this page was built)

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