DragonFlight
A component script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
clamp(v: number, lo: number, hi: number) → number
| arg | type | description |
|---|---|---|
| v | number | |
| lo | number | |
| hi | number |
groundAt(x: number, z: number) → number
Ground height. The terrain publishes a sampler; until it does, a flat plain, so the dragon still has something to land on.
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
ensureDragon( ) → State
refreshMesh(mass: number, traits: Sim.Traits, fold: number, gutFill: number) → void
Rebuild the body only when the morphology moves a bucket. The dragon you see IS the dragon the sim flies: same mass, same wing area, same span.
| arg | type | description |
|---|---|---|
| mass | number | |
| traits | Sim.Traits | |
| fold | number | |
| gutFill | number |
defineControls( ) → void
Bound as named actions so the same code answers keyboard, pad or touch, and so a player can rebind.
awake( ) → void
start( ) → void
ensureLoops( ) → void
One child entity per continuous cue, each carrying its own Audio component, all silent until the sim gives them a reason. Children rather than named secondary components on one entity, because `component.get` cannot retrieve a component by name -- a named instance can be created but never read back. Built lazily rather than in `start()`: editing this file hot-reloads the definition and reconciles live instances WITHOUT re-running `start`, so anything built there is lost on the next edit while the module table is rebuilt.
setLoop(name: string, volume: number, pitch: number) → void
| arg | type | description |
|---|---|---|
| name | string | |
| volume | number | |
| pitch | number |
updateAudio(d: State.Dragon, out: State.TickOutput, updraft: number) → void
Drive every continuous cue from the numbers the HUD is showing, so the soundscape IS the readout: wind rises with airspeed, the buffet comes in as the stall margin closes, the thermal sings only when you are truly climbing in one, and the heart hammers when you are burning your own body.
| arg | type | description |
|---|---|---|
| d | State.Dragon | |
| out | State.TickOutput | |
| updraft | number |
readInput( ) → void
tryLaunch(d: State.Dragon, out: State.TickOutput) → boolean
Leap into the air. A standing launch is a hover, and a hover is the most expensive thing a wing can do -- so it is one explosive push, not a hold. Whether it works is the comparison the Codex prints: burst muscle power against the induced power to hold your weight on still air. Past a mass the answer is simply no, and you go find a cliff or a thermal.
| arg | type | description |
|---|---|---|
| d | State.Dragon | |
| out | State.TickOutput |
tryBreathe(d: State.Dragon) → void
| arg | type | description |
|---|---|---|
| d | State.Dragon |
tryEat(d: State.Dragon) → void
| arg | type | description |
|---|---|---|
| d | State.Dragon |
tryDisplay(d: State.Dragon) → void
| arg | type | description |
|---|---|---|
| d | State.Dragon |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
editorUpdate(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
onDestroy( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
Inside
2 problems across 1 itemagent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.