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

createWorldfunction

Makes a world.

Import it

import { createWorld } from "@johnmorrisdotca/karakuri/physics";

Definition

function createWorld(options?: { gravity?: number; substeps?: number; iterations?: number; }): World

Parameters

NameTypeDescription
options (optional){ gravity?: number; substeps?: number; iterations?: number; }

Native physics tuning or creation options described by this signature.

Returns

World

Makes a world.

Examples

import { createWorld } from "@johnmorrisdotca/karakuri/physics";

console.log(createWorld({gravity:0}).gravity);
0

What it prints (run when this page was built)

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