Reference · Rockets, variants, parts and the fit check
frameAtfunction
Everything the picture needs at a place on the timeline, for a vehicle height metres tall.
Import it
import { frameAt } from "@johnmorrisdotca/uchusen-rockets";
Definition
function frameAt(flight: Flight, position: number, parts: readonly FlightPart[], height: number): FlightFrame
Parameters
| Name | Type | Description |
|---|---|---|
flight | Flight | A flight. |
position | number | A place on the timeline. |
parts | readonly FlightPart[] | Each part's slot and the height of its base in the stack, in metres. |
height | number | The vehicle's height in metres. |
Returns
FlightFrame
The frame to draw.
Examples
import { flightOf, frameAt } from "@johnmorrisdotca/uchusen-rockets";
const flight = flightOf("falcon-9", "block-5");
if (flight) console.log(frameAt(flight, 1, [{ slot: "first-stage", baseY: 0 }, { slot: "second-stage", baseY: 41 }], 70).burns);{ 'first-stage': 9 }What it prints (run when this page was built)