Log inGet started
World

EMBERLINE

Branchmain
Branchesmain
Commite3b1d97d67

README.md

staging.fx

How a hit lands. Registered as Bus.services.fx.

Bus.call("fx", "spark", x, y, "heavy", { dir = 1 })
Bus.call("fx", "dust", x, 0, "land")
Bus.call("fx", "flash", "white", 12)
Bus.call("fx", "letterbox", 4)

The three strengths are three events

  • light — a thin white star, 40 sheet pixels, four frames. No shake, three frames of hitstop.
  • medium — a hot core inside an ember ring with grit thrown out of it. A nudge of shake, six frames of hitstop.
  • heavy — one frame of pure white-out at the contact point, then an ember shockwave with eight long spokes, debris and smoke. A directional camera kick, a frame tilt, twelve frames of hitstop and a two-frame screen flash.

Plus block (a cool guard flash that faces the attacker), super (the biggest single thing in the game), and dust for landings and dashes.

How it is built

Every effect is a pooled pixel canvas whose frames are drawn once, at boot, and then only stepped. Nothing is drawn at fight time: a canvas write costs tens of milliseconds and setActiveFrame costs a fifth of one. The pools live under a temporary parent so none of it is saved into the scene, and sparks draw at z = 4.6 — in front of the stage's foreground layer, because an impact hidden behind a lamp post is an impact the player did not see.

The full-frame overlays (flash, speed lines, cinematic bars) parent to the camera, so they cover the frame at every zoom. A "fade" is a scanline dither rather than an alpha ramp: a pixel canvas has no alpha, and an opaque grey sheet is just an opaque grey sheet.

Surface

spark(x, y, kind, opts) · dust(x, y, kind, opts) · shake(mag, frames) · hitstop(frames) · flash(color, frames, startStep) · curtain(color, step) · curtainOff() · clearOverlays() · speedlines(frames) · letterbox(rows) · update(dt) · build() · teardown()

opts.dir accepts a number or a word ("left" / "right"); it is normalised on the way in.