Reference · Native level collections
StretchGrabberEntrytype
A level, the waypoints of one way to win it, and of one way to lose it.
Import it
import type { StretchGrabberEntry } from "@johnmorrisdotca/karakuri/levels";
Definition
interface StretchGrabberEntry extends GrabLevel {
solution: readonly Pt[];
loss: readonly Pt[];
}
Members
| Name | Type | Description |
|---|---|---|
solution | readonly Pt[] | |
loss | readonly Pt[] | |
base | Pt | |
star | { x: number; y: number; r: number; } | |
maxLength | number | The most the arm can stretch to, in units of length. |
solids | readonly Solid[] | |
hazards | readonly Hazard[] |
Examples
import type { StretchGrabberEntry } from "@johnmorrisdotca/karakuri/levels";
import { STRETCH_GRABBER_LEVELS } from "@johnmorrisdotca/karakuri/levels";
const value: StretchGrabberEntry = STRETCH_GRABBER_LEVELS[0];
console.log(value);{
base: { x: 180, y: 452 },
star: { x: 70, y: 70, r: 13 },
maxLength: 694,
solids: [ { kind: 'wall', ax: 0, ay: 270, bx: 250, by: 270, r: 6 } ],
hazards: [ { kind: 'laser', ax: 0, ay: 400, bx: 110, by: 400 } ],
solution: [
{ x: 180, y: 452 },
{ x: 272, y: 272 },
{ x: 264, y: 252 },
{ x: 88, y: 80 }
],
loss: [ { x: 55, y: 400 } ]
}What it prints (run when this page was built)