projectiles
library
Functions
-
beat(double t, double period, int n, int seed, double life(Rng r), void fn(double age, double life, Rng r, int i))
→ void
-
Steady emitter for seamless loops: particle
i is born at i * period / n.
-
casing(double x, double y, double vx, double vy, double va, double age, double g, double floor, [double bounce = 0.42, double a0 = 0])
→ CasingState
-
Evaluates closed-form bouncing casing kinematics at
age.
-
cloud(Painter p, List<CloudPuff> list, List<int> rRamp, List<int> wrRamp, {double dens = 1.5, double max = 0.86, bool clip(double x, double y)?, double lit = 1})
→ void
-
Merges
list of puffs into a single quantized, top-lit translucent smoke volume.
-
drawCasing(Painter p, CasingState k, List<int> b, [double fade = 1])
→ void
-
Draws a 3 px brass casing slug and impact glint.
-
flash(Painter p, double x, double y, double a, List<FlashLobe> l, List<int> c, int seed)
→ double
-
Renders flash lobes
l at (x, y) along angle a, returning flash reach.
-
flashShape(Rng r, int f, {double size = 1, List<double> spike = const [12, 20], List<double> diag = const [5, 10], List<double> cross = const [3, 6], List<double> back = const [2, 4.5], double core = 0.7})
→ List<FlashLobe>
-
Generates spiky muzzle-flash lobes from
r for frame f (1 or 2).
-
pixelShape(int x0, int y0, int w, int h, void build(void set(int px, int py, String ch)))
→ PixelShape
-
Builds a pixel shape with an automatic 1 px
'o' outline.
-
puff(Painter p, double x, double y, double r, double a, int c, [double cap = 1, double warm = 0, int wc = 0, double wa = 0])
→ void
-
A soft smoke puff with body, lower core, young top cap, and optional fire light.
-
spark(Painter p, double x, double y, double vx, double vy, double k, List<int> s, [double glow = 0.45, double stretch = 0.022, double max = 9])
→ void
-
Two-tone velocity-stretched spark streak with glow.
-
turnSprite(Painter p, List<String> rows, Map<String, int> pal, double x, double y, double ang, double px, double py, [double a = 1])
→ void
-
Draws a character sprite rotated by
ang around pivot (px, py) at (x, y).
-
wake(double x, double y, double vx, double vy, double age, double v, double k, [double g = 0])
→ (double, double, double, double)
-
Position and screen velocity after
age seconds in the frame of a projectile
flying right at v px/s, with drag k (1/s) and gravity g.