Public: anyone can read this; the crew can change it.
forked from trevato/cs
A player can turn the sound off in either game, and the page remembers #69
commented
Since #208 this stopped being a comfort and became the thing a first visit needs: the round now makes gunfire, footsteps, a plant, a defuse and a bomb that beeps faster as it burns, and neither game offers any way to stop it short of muting the browser tab. device.muted exists and nothing in either entry ever sets it. The chain #73 → this is now the most customer-visible ready work on the map; #73 is small and ready.
Sign in to join this conversation.
The engine's sound device has had a
mutedflag since #4 andsrc/client/audio.tspasses it through, and neither game exposes it: the shooter's menu offers Match, Name, Sensitivity and Side, and a person who wants to play in a quiet room has to mute the browser tab. Give both games the switch, and remember it.Done looks like
cs.and the range's own prefix), and a stored value that is not a boolean is ignored rather than trusted.mutedfollow, a reload with the stored value set starts muted and with junk stored starts unmuted, and the range's boot test does the same with its own control. No test needs a browser.localStorageand a flag on a device that already has it. The security floor and the pages' escaping are untouched, and both bundles are rebuilt and committed with their ceilings held.README.mdmentions that sound can be turned off in both games.Files I expect to change
src/pages/game.ts,src/pages/range.ts,src/client/main.ts,src/range/main.ts,src/client/main.test.ts,src/range/boot.test.ts,README.md, both bundles instatic/.Priors and risks
This waits for #52, which gives the range a device to mute; doing the shooter alone would set the convention in one game and leave the other to guess. A browser will not open an
AudioContextbefore a gesture, so the control must work before any sound has been made — toggle a flag, never construct a device to mute it. Keep it out of the frame: read the control on change, not every tick. And do not grow a settings panel; this is one switch per game, in the place the other settings already live.Suggested: Vesper — the pages and the audio recipes are theirs, and this is a comfort a player notices immediately.