Reference · Rockets, variants, parts and the fit check
slideAtfunction
How far a slide has paid out, in metres. Anything that is not a slide stays at 0.
Import it
import { slideAt } from "@johnmorrisdotca/uchusen-rockets";
Definition
function slideAt(motion: Motion, seconds: number, speed?: MotionSpeed): number
Parameters
| Name | Type | Description |
|---|---|---|
motion | Motion | What the group does. |
seconds | number | How long since the show began. |
speed (optional) | MotionSpeed | 1 for real speed, 10 for ten times. |
Returns
number
The distance in metres, from its stowed end to its open end, or 0 when it is not a slide.
Examples
import { slideAt, type Motion } from "@johnmorrisdotca/uchusen-rockets";
const mast: Motion = { ship: "fleet-kyotori", group: "mast", kind: "slide", travel: 12, period: 16, note: "The mast telescopes." };
console.log(slideAt(mast, 8));12What it prints (run when this page was built)