Log inGet started
World

Anvil Crown

Branchmain
Branchesmain
Commit0c3c8404d1

README.md

flight — the storm-runner's hands

The part of ANVIL CROWN the player operates. It owns the airframe's motion, its nose, its cannon and its hull, and it registers itself as the flight system (order 10 — first in the frame, so everything else reads a runner that has already moved).

The three things it is trying to make true

The airframe has mass. Input is acceleration, never position. Drag is deliberately low (A.K.RUNNER.dragX), which is what lets the storm's crosswind be a force you fly against continuously rather than a nudge.

Flying is aiming. The cannon fires along the nose, and the nose yaws into the airframe's own lateral velocity (yawPerSpeed, capped at maxYaw). Get shoved sideways by the wind and your rounds go sideways with you — so correcting the drift is not something you do before aiming, it is the aiming.

The trigger is a rhythm. A.rules.cool(dt) runs every frame and every round adds heatPerShot on top of it. With the shipped constants that makes roughly a 70 % duty cycle sustainable indefinitely and a held trigger not: hold it and the bar fills, the gun locks out, and it then cools at the slower locked rate until it releases at releaseAt.

What you read without reading a number

  • The tracers change material with the heat: cold cyan while there is room, amber as it fills, furnace orange just before it locks.
  • The gun-port glow swells with the same curve and flares on each round.
  • On lockout the glow goes red and pulses, and no rounds leave.

Hail

Hail is weather, not a projectile: it spends no i-frames and does not care how much hull is left. It cares how fast you are moving through it — a storm-runner takes hail on its leading edge — so K.HULL.hailTick is scaled by the airframe's speed as a fraction of its top speed. The band where the wind is throwing you around is exactly the band where being thrown around costs hull. Fly the hail gently.

What this slice writes

A.state.hull, heat, locked, firing, alive, noseAngle, runner, runnerX, runnerY, runnerVX. It raises shake on a hit, and fire / overheat come out of it (the latter via A.rules.addHeat / A.rules.cool).

It calls A.rules.applyDamage for every hit event anyone emits, so the whole game agrees on one set of i-frames.

The contract other slices use — A.flight

The table this module returns is also hung on the shared spine as A.flight, so it survives a hot-reload and is reachable without requiring this module:

FieldWhat it is
A.flight.roundsthe round pool; a live round has alive == true and carries x, y, vx, vy, dmg, angle
A.flight.eachRound(fn)call fn(round) for every live round
A.flight.killRound(r)consume a round — what a threat calls when one reached it
A.flight.liveRounds()how many are in the air
A.flight.hitRadiusthe runner's collision radius, for a threat testing against state.runnerX/Y
A.flight.damagewhat one round does

Rounds do not test themselves against threats. The threats and crown slices own their own positions, so they own the test: walk eachRound, compare against your own hitbox, apply your damage, and call killRound on the round you consumed. Damage in the other direction is the hit event — emit it and this slice decides what it does to the hull.

Controls

anvilFlight.inputMap, activated by this module and released with the map's player group when a menu or a cutscene stands the player down.

ControlKeyboard / mouseGamepadTouch
flyWASDleft stickleft stick zone
fireSpace, left mousesouth, right shoulderFire button, lower right

How it is loaded

A module's top level runs on its first require, and that top level is what calls A.register. FlightHost.component — attached to the scene's Bullets anchor — is the require. The world entrypoint also loads every slice module it finds, so either route is enough on its own.