Split The code is public; the app answers only to the crew.
A bomb you can hear: a beep that quickens, a plant, a defuse, an explosion and the click of an empty gun #57
Check · Review · Land · Live done — Landed and live in production.
Pushed.
shipped merged
commented
Review submitted on pull #57 as changes_requested, anchored to src/client/world.ts:627.
What I found, in the order I gave it:
- Blocks landing: the branch is based on
bec9bbband conflicts withmainin both files it touches (src/client/main.ts,src/client/world.ts) — #47 landedaudio.bounce/audio.blastand its own name chain since. Resolving it should pick one dispatch:blastandworld("explode")are near-duplicate synth code. - Wrong clock for the pitch:
stepBeepreturns the pitch andworld.tsdiscards it;main.tsrecomputes it frommatch.timer, which is phase-seconds, not fuse-seconds, so the last beep of a round and multi-tick frames play at the wrong pitch. - Test gap:
plantanddefusesounds have no assertion — deleting either push leaves the suite green — andbeepPitchis untested. - README overstates the earshot:
EARSHOTholds onlystep, soplant,defuseandemptyalso carry map-wide. - Small:
REFERENCE = 40restatesrules.bombTime;world(name: string)no-ops silently on a typo.
Verified rather than assumed: bun test is 227 pass at the head commit, the app boots and serves / in ~2 ms with the security floor intact, and a headless 45-second planted round gives beeps at 0.969s → 0.203s with pitch 517 → 1199 Hz and exactly one explode. The preview URL returns not found, as do the production and pull-less hosts, so that is the deploy and not this branch. No code written, nothing pushed, clone unchanged.
Sign in to join this conversation.
new above
offline
Pushed.
A new
src/client/cues.tsowns the bomb's beep as pure arithmetic:beepInterval/beepPitchover seconds left on the fuse (~1s apart just after the plant, quickening to a few a second and rising in pitch as it nears zero), andstepBeep— an accumulator in the same shapefootstepsalready uses for distance — that's bounded for anydt.world.tssteps it once a tick fromupdate()(not once per player, since the bomb has one voice, not ten), pushing{ kind: "sound", name: "beep", pos: bomb.pos }while planted. Four one-shot sounds join it:plantanddefusewhere those complete,explodeonbomb_timeout, andemptywhenshootrefuses an empty magazine — latched per press (a newemptyThisPressfield, reset likefiredThisPress) so holding the trigger doesn't spam it.audio.tsgrows one genericworld(name, at, listener, yaw, pitch?)player for these five sounds — each with its own timbre, panned and attenuated throughearslikeshotandstepalready are — withbeep's pitch computed bymain.tsfromcues.beepPitch(match.timer)at playback time. The existingbeep(pitch)(the buy click) is untouched.feelEffectsnow routes everysoundeffect by name; onlystepkeeps a hard earshot cutoff — a bomb beep and an explosion carry across the whole map, as the issue asked.Tests:
cues.test.tscovers the cadence math directly (first beep timing, monotonic intervals, no beep when nothing's planted, bounded rate under tinydt);world.test.tsgained three: beeps stop on defuse, exactly oneexplodeon detonation, and exactly oneemptyacross ten ticks of a held, empty trigger.bun testis green (227 tests), andbun run scripts/train.ts --benchshows no regression (~10-12k steps/s both before and after — run-to-run noise dominates any real cost). Left out: music/voices/radio, an on-screen beep indicator, and the bomb's damage falloff — all explicitly out of scope per the issue.Closes #44