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

Themetype

The colours and sizes a game draws with, read from the page's custom properties (--kk-*) so that it follows light, dark and the family's cloths.

Import it

import type { Theme } from "@johnmorrisdotca/karakuri/play";

Also exported from: @johnmorrisdotca/karakuri

Definition

interface Theme {
    board: string;
    deep: string;
    ink: string;
    muted: string;
    accent: string;
    good: string;
    bad: string;
    gold: string;
    water: string;
    lava: string;
    stone: string;
    paper: string;
    dark: boolean;
    font: string;
    lang: "en" | "ja";
}

Members

NameTypeDescription
boardstring

The play area's floor.

deepstring

The darker ground, for grooves and shadows.

inkstring
mutedstring
accentstring

The line the player draws, and highlights.

goodstring
badstring
goldstring
waterstring
lavastring
stonestring
paperstring

A light colour that reads on accent, bad and the game colours.

darkboolean
fontstring
lang"en" | "ja"

The language words drawn on the canvas are in.

Examples

import type { Theme } from "@johnmorrisdotca/karakuri/play";
import { defaultTheme } from "@johnmorrisdotca/karakuri/play";

const value: Theme = defaultTheme();
console.log(value);
{
  board: '#f6f1e6',
  deep: '#e4dcc9',
  ink: '#2b2a28',
  muted: '#8a8473',
  accent: '#2f6f55',
  good: '#2f8f5b',
  bad: '#c2453a',
  gold: '#e0a82e',
  water: '#3b8fd9',
  lava: '#e8561f',
  stone: '#8d8a82',
  paper: '#fffdf7',
  dark: false,
  font: 'system-ui, sans-serif',
  lang: 'en'
}

What it prints (run when this page was built)

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