Reference · Controllers and canvas player
StatusEventtype
What a status callback is given.
Import it
import type { StatusEvent } from "@johnmorrisdotca/karakuri/play";
Definition
interface StatusEvent {
game: KarakuriGame;
level: number;
status: Status;
result: Say | null;
text: string;
info: string;
}
Members
| Name | Type | Description |
|---|---|---|
game | "save-the-character" | "pin-rescue" | "nuts-and-bolts" | "stretch-grabber" | "grid-escape" | "rope-cut" | "tube-sort" | "choice-story" | |
level | number | |
status | Status | |
result | Say | null | |
text | string | The words of |
info | string | The line the bar would show about the level, in the player's language (moves made, ink left, and so on). |
Examples
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'
}What it prints (run when this page was built)