Reference · Rockets, variants, parts and the fit check
tractorBeamfunction
The pieces of the beam. A carry is a cone of 24 faces, narrow at the drone and wide at the part. Attach and release add a flash at the part. While the part settles the cone runs to where the part is between its start and the slot, and it is gone once the part is home. Reduced motion draws a dotted line and no flash.
Import it
import { tractorBeam } from "@johnmorrisdotca/uchusen-rockets";
Definition
function tractorBeam(ends: BeamEnds, phase: BeamPhase, reduced?: boolean, settle?: number): Piece[]
Parameters
| Name | Type | Description |
|---|---|---|
ends | BeamEnds | The drone, the part and the slot. |
phase | BeamPhase | Attach, carry, release or settle. |
reduced (optional) | boolean | True when the reader asked for reduced motion: a dotted line, and no flash. |
settle (optional) | number | How far the part has settled, from 0 to 1. Only the settle phase reads it. |
Returns
Piece[]
The pieces. Empty once the part is in its slot.
Examples
import { tractorBeam, type BeamEnds } from "@johnmorrisdotca/uchusen-rockets";
const ends: BeamEnds = { from: [0, 0, 0], part: [0, 8, 0], slot: [0, 10, 0] };
console.log(tractorBeam(ends, "settle", false, 1).length);0What it prints (run when this page was built)