本文へ移動

Karakuriからくり

8つの標準のパズルで遊び、探索や再現できる物理を使い、ポインターやキーボードで操作する盤を表示できます。

「からくり」は、仕組みや工夫した装置を表す言葉です。 名前について(英語)

目次

リファレンス · 操作とキャンバスの表示

StatusEvent型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

What a status callback is given.

インポート

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

定義

interface StatusEvent {
    game: KarakuriGame;
    level: number;
    status: Status;
    result: Say | null;
    text: string;
    info: string;
}

メンバー

名前型説明
game"save-the-character" | "pin-rescue" | "nuts-and-bolts" | "stretch-grabber" | "grid-escape" | "rope-cut" | "tube-sort" | "choice-story"
levelnumber
statusStatus
resultSay | null
textstring

The words of result in the player's language ("" while playing), for a page that draws its own result.

infostring

The line the bar would show about the level, in the player's language (moves made, ink left, and so on).

例

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

const controller=createController("tube-sort",1);
const value: StatusEvent = {game:"tube-sort",level:1,status:controller.status,result:controller.result,text:"",info:say("en",controller.info.key,controller.info.values)};
console.log(value);
{
  game: 'tube-sort',
  level: 1,
  status: 'playing',
  result: null,
  text: '',
  info: 'Pours 0'
}

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/karakuri 0.2.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。