impacts library

Properties

bluntHitEffect → SimulatedEffect
final
bulletImpactEffect → SimulatedEffect
final
critHitEffect → SimulatedEffect
final
groundSlamEffect → SimulatedEffect
final
heavyLandingEffect → SimulatedEffect
final
hitFlashEffect → SimulatedEffect
final
hitSparkEffect → SimulatedEffect
final
impactFrameEffect → SimulatedEffect
final
impactsEffects → List<PixelEffect>
final
kOutline → int
final
kSoot → int
final
parryEffect → SimulatedEffect
final
ricochetEffect → SimulatedEffect
final
shieldBlockEffect → SimulatedEffect
final

Functions

brokenRing(Painter p, double x, double y, double r, double th, List<RingSeg> segs, double brk, int c, [int? c2, double k = 1.0, double sy = 1.0, double maxY = double.infinity]) → void
A ring that breaks into arcs: segs evenly round the ring. brk 0 draws a whole ring th thick; as brk grows each arc shrinks, tapers at both ends into a crescent and drifts out at its own speed. c is the outer edge's color, c2 the inner's; sy squashes it onto a plane; nothing is drawn below maxY (a floor).
drawCracks(Painter p, List<CrackLine> cracks, double g(CrackLine c), double heat(double d), List<int> hot, int dark, int lip, [double k = 1.0]) → void
Draw cracks grown to g(c) px of their length. heat(d) 0..1 at distance d along a crack lights it from the hot ramp (bright to dark) before it cools to dark; lip is the lit lower edge; k dithers them out.
dustRing(Painter p, double cx, double cy, double r, double w, double k, int c, {double sy = 1.0, double ph = 0.0, double brk = 0.0, double lit = 0.35, double maxY = double.infinity, int half = 0}) → void
A soft, lumpy ring of dust round (cx, cy): radius r, w thick (lumps swell it), alpha k, translucent and lit on its upper side.
frontCrescent(Painter p, double x, int dir, double h, double w, List<int> cols, [double k = 1.0]) → void
A standing crescent shock front on the floor (y = 0): it leans back from a leading edge low at x, dir 1 racing right ")", -1 left "(". h tall, w thick at its widest; cols edge, body, back bright to dark; k dithers it out.
makeCracks(Rng r, int n, {(double, double) len = (14.0, 40.0), double dive = 0.85, double maxY = 22.0, double forks = 0.5, (double, double) x0 = (1.0, 5.0)}) → List<CrackLine>
Cracks in the floor face below (0, 0): n jagged lines, alternately left and right, mostly shallow, a few diving steeply, some forked.
rock(Painter p, DebrisBit b, List<double> pts, StonePalette st) → void
A faceted rock tumbling at angle b.a: every facet shaded by how it faces the light, a lit top face, a dark outline, dithering out over its last half second.
rockShape(Rng r, [int n = 6]) → List<double>
A rock's outline: n vertex radii round its centre.
spikes(Rng r, int n, double aim, {(double, double) len = (7.0, 10.0), (double, double) w = (1.5, 2.1), double fwd = 1.8, double back = 0.6, double jag = 1.0, double jit = 0.18}) → List<ImpactSpike>
Spikes for a hit star: n of them round the circle, longer towards aim (fwd) and a little behind it (back). len and w: (min, max) base length and root half-width; jag scales every other spike (short teeth between).
star(Painter p, double x, double y, List<ImpactSpike> list, double sc, double th, List<int> cols, [double a = 1.0, double heart = 2.4]) → void
A hit star: tapered spikes in three passes (a rim, a body that's paler near the root, a hot core) round a hot heart. sc stretches the spikes, th thins them, cols rim, body, inner, core, a dithers it out.
stone(Object c) → StonePalette
Stone colors from one body color: light, body, shade, dust (lighter and greyer), lip (a lit broken edge).