Stop bodies blinking out, and give the cone a core and edges

The blinking was drawZombie validating its frame count against the LAST frame
only: a set with (say) z_h2 missing but z_h4 present kept N = 4, the walk cycle
stepped onto a name that had never loaded, and drawStatic silently drew nothing.
The body vanished for that frame of the cycle and came back on the next one,
forever. One cached 404 -- this project's oldest trap -- is enough to cause it.
It holds frame one now: a body that stops animating is a bug you can see, one
that flickers in and out reads as the game breaking. SPRV bumped to flush
whatever his phone has cached.

And no ctx.filter anywhere. The cut line was briefly the sprite redrawn clipped
to a band and flattened by a canvas filter, which put it exactly on the
silhouette -- and on the iPhone the line did not draw at all. Unsupported or
leaking past its restore, a rendering feature that fails silently on the target
device is not worth a pixel of polish. It is a plain bar again, brighter, and it
crosses the odd gap between the legs, which is the trade.

The cone gets the reference's look: a horizontal gradient across the width with a
near-white core down the centre line falling to blue at the edges, plus the depth
falloff along its length, plus stroked outer edges. Canvas has no 2D gradient, so
it is filled in eight slices each carrying its own across-gradient -- enough that
the seams vanish, which is what the old nested wedges got wrong.

Test mode: barrels gone (the rack already holds everything they would give you)
and the crowd raised to 16 bodies at a spawn every 0.9s, so it does not run dry
between kills.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Opus 5 committed 2026-08-03 15:58:16 +02:00
1 parent 337def8526
commit 8f16d085f0
5 files changed
+97 -78

No files matched your search

+24
View File
@@ -418,6 +418,24 @@ free to be the KILL range instead of a number tuned to one camera.
**Weapon sounds** are a `sfx` field on the WEAPONS row: `thump` (beacon, `boom`), `swoosh` (rocket,
`whoosh`), otherwise the gun's every-other-round tick.
## THE BLINKING BODIES, and why a missing frame is worse than a missing sheet (2026-08-03)
Oliver: "on iphone the zombies were blinking in and out of existence". **`drawZombie` validated its
frame count against the LAST frame only** — `if (!SPR['z_' + v + N]) N = 2` — so a set with, say,
`z_h2` missing but `z_h4` present kept `N = 4`, the walk cycle stepped onto a name that had never
loaded, and `drawStatic` silently drew NOTHING. The body vanished for that frame of the cycle and
came back on the next one, forever. A single cached 404 (this project's oldest trap) is enough.
`if (!SPR[name] && SPR['z_' + v + '1']) name = 'z_' + v + '1';` — hold frame one. **A body that stops
animating is a bug you can see and diagnose; one that flickers in and out reads as the game
breaking.** Every silent `SPR[x] ? x : fallback` in this file deserves the same suspicion.
**And no `ctx.filter`, anywhere.** The cut line was briefly the sprite redrawn clipped to a band and
flattened to one colour by a canvas filter, which put it exactly on the silhouette. On an iPhone the
line did not draw AT ALL. Whether that was the filter being unsupported or leaking past its
`restore()`, a rendering feature that fails silently on the target device is not worth a pixel of
polish — the line is a plain bar now and crosses the odd gap between the legs, which is the trade.
## The laser plane, and cutting bodies with it (2026-08-03)
Settled with Oliver in discussion, then built. **The beam is a real plane at `TUNE.beamY` (1.15 m)**
@@ -425,6 +443,12 @@ that holds that height all the way out instead of sloping to the ground — that
makes the rest possible. Sloping, it lay flat on the grass across the whole far half, so there was
nothing for it to cut exactly where the crowd stands.
- **The fill is TWO gradients**, matching the reference Oliver sent: a horizontal one across the
width (near-white down the centre line, falling to the weapon's blue at the edges) and a depth one
along the length. Canvas has no 2D gradient, so the wedge is filled in eight slices along its
length, each with its own across-gradient at that slice's depth alpha — enough slices that the
seams vanish. The two long edges are STROKED: the reference reads as a plane because its edges are
drawn, not merely where the fill stops.
- **One flat translucent triangle**, apex at the player's CHEST (`beamOriginY` 1.25 — emitted from
the racket head at 2.2 m the apex hung in the air and read as detached), opening out down the
court, alpha falling with distance. It was four nested wedges composited `lighter`, and that