pattern

Use when

Wiring feedback (impact, pickup, death) or deciding what belongs in the sim vs the view.

Juice as Choreography

What it is. Feel is not decoration sprinkled on a sim — it’s a choreography the sim authors and the view performs. The sim resolves an event instantly and returns a script (what happened, when); the view replays it as particles, shake, pops, and sound. FUN.md law 6, the cosmetic-view rule: views must be deletable without changing a single sim bit. Juice is loud and free of gameplay risk because it never touches the hash.

Player fantasy. “That hit felt like it mattered.” Weight, punch, satisfaction — the difference between clicking a spreadsheet and landing a blow. The game answering your input like it heard you.

Why it works

Levers

LeverThe Hayao primitiveEnvelope (JUICE.md Part 2)
Screen shakeShaker (camera’s parent)land ≈ 0.12, death ≈ 0.5; quadratic falloff, decay ≈ 3/s
Hit-stopfreeze frames on impactsells weight; > ~12 frames reads as a hitch
Impact particlesParticles + PARTICLE_PRESETSanswer an event, life 0.2–0.6s, then vanish
Pop numbers / pickupsFloatingText + FLOAT_PRESETSone pop per event; don’t stack to soup
AtmosphereAmbientField + AMBIENT_PRESETSpersistent field (snow/ash), not a burst stream
DepthParallaxLayer0 = far/pinned, 1 = foreground
Procedural SFXaudio.tone/blip/play/successpitch-rising combo; the second sense, cheaply

(Grep docs/API.md before citing — all of the above are real; examples/small-flame wires this kit and passes its feel gates.)

Applied across genres

GenreThe signature choreography
Physics arcade (genre-physics-arcade, anchor-peggle)Pitch-rising ricochet chain, big burst on multipliers — the juice is the product
Action-adventure (genre-action-adventure)Hit-stop + flash + i-frame shimmer sell the blow (FUN.md §4)
Horde survival (genre-horde-survival)Screen full of pops on a level-up; the “number goes up” feast
Match-3 (genre-match3)The purest law 6 — the deterministic sim returns the cascade script, the view animates it (FUN.md §13)
Deckbuilder (anchor-balatro)The score-multiplier crescendo; each joker its own beat
Precision platformer (genre-precision-platformer)Dust on land, shake on death, snappy landing — feel that rewards clean movement
Rhythm (genre-rhythm)Feedback on the beat — sim time drives both the hit and its flourish (FUN.md §18)

Overdone when…

Feel is made checkable — this is the whole point of Channel 4:

Worked micro-example

“A sword swing that feels like it lands.” The sim resolves the hit instantly and returns a script: { hit: true, at: pos, hitstop: 5, knockback: dir }. The view performs it — Shaker.addTrauma(0.12), a PARTICLE_PRESETS.hit() burst at pos, a 5-frame freeze that buffers the next input through it, an audio.tone that pitches up on a combo, and a FloatingText damage pop. That’s the 2-senses contract met several times over (sfx + particles + flash + shake), all cosmetic, all driven off the event not read-back state. Delete the whole view and the sim hash is identical (FUN.md law 6). Prove it: run headless, hash; run with view, hash; assert equal — and feedbackIssues(FEEDBACK, ['hit']).length === 0 guards the ≥2-senses rule.

Composes with

See also

This module rendersthe repo's markdowndirectly — edit it there, it changes here.