Build accessibility into browser games, for players with low vision, color blindness, deafness, motor and cognitive disabilities. Tested helpers for captions with speaker names and sound cues with direction, a seizure-safe flash limiter, game speed, wider timing windows, aim assist, one-switch scanning, minimum text sizes, a high-contrast palette, and a screen-reader layer that mirrors canvas m...
Download skill (.zip) Files on GitHubGame accessibility
Start with the options that help the most players for the least work:
| Priority | Option | Helps |
|---|---|---|
| 1 | Remappable controls, hold-or-toggle (game-control-customization) | Motor, one-handed, different devices |
| 1 | Subtitles and captions, on by default | Deaf and hard of hearing, noisy places, muted phones |
| 1 | Text size, contrast backing behind text | Low vision, small phones |
| 1 | Screen shake, flashing and reduce-motion settings | Motion sickness, photosensitivity, vestibular disorders |
| 2 | Color not the only cue, plus a color filter (game-accessibility-audit) | Color blindness (1 in 12 men) |
| 2 | Game speed, timing windows, aim assist, skip puzzle or invincibility | Motor, reaction time, cognitive |
| 2 | Pause anywhere, replayable tutorial, objective always visible | Cognitive, interruptions |
| 3 | One-switch mode, screen-reader menus, sound cues with direction | Severe motor, blind and low vision |
assets/access.js
import { ACCESS_DEFAULTS, createCaptions, createFlashGuard, scaledDt, timingWindow, aimAssist, createScanner, textPx, palette, labelCanvas, createAnnouncer, mirrorMenu } from "./access.js";
const captions = createCaptions({ soundCues: settings.get("soundCues") });
captions.say("We have to go!", { speaker: "Mia" });
captions.say("Footsteps", { sound: true, direction: (enemy.x - player.x) / 300 }); // "[Footsteps, left]"
draw last: captions.draw(ctx, W, H, { size: settings.get("captionSize"), background: 0.75 });
const flash = createFlashGuard({ enabled: settings.get("flashing") }); flashAlpha = flash.allow(0.8); // never more than 3 a second
const dt = scaledDt(rawDt, settings.get("gameSpeed")); // 0.25..2
const hitWindow = timingWindow(80, settings.get("timingWindow")); // ms
aim = aimAssist(player, aim, enemies, { strength: settings.get("aimAssist") });
const C = palette(NORMAL_COLORS, settings.get("highContrast"));
ctx.font = `${textPx(18, settings.get("textScale"))}px sans-serif`;
labelCanvas(canvas, "Gem Dash: score 1200, wave 3"); const say = createAnnouncer(); say.say("Wave 3", { urgent: false });
const sr = mirrorMenu(menu); after the menu changes: sr.sync(); // Tab and screen readers reach the canvas menu
- Add
ACCESS_DEFAULTSto the settings schema (game-settings-system) so every option is saved and applied instantly. mirrorMenuworks with game-menu-system menus: hidden real buttons in the same order, arrow keys change sliders and choices, Esc goes back, clicks activate.- One-switch:
createScanner(n)moves the highlight through choices by itself; any single input picks.
Rules
- Defaults matter: captions on, flashing reduced, shake on but adjustable, reduced motion follows the system.
- Options in the first menu the player sees, not buried; changeable at any time without restarting.
- Easy modes are not cheating: don’t shame them (“Story mode”, not “Baby mode”), don’t block achievements without a reason.
- Captions: under two lines, at least 16 px, speaker names, background box, sound cues for anything you’d need to hear.
- Text over the game always has a backing. Pick colors that pass contrast (game-accessibility-audit
contrast.js).
Tested
Node tests: captions with speakers, sound cues off by default, direction labels, repeated sounds not stacking, line limit, expiry and drawing; the flash limit, softening and off switch; game speed limits; timing windows; aim assist inside and outside the cone; the scanner; text minimums; high-contrast palette. The screen-reader menu was checked in a browser with a game-menu-system menu (focus, arrow keys, activation). The device lab shows captions with sound direction and game speed.
Pitfalls
Options that don’t do anything, subtitles without speaker names, text-only fixes for color problems, flashing that ignores the setting, accessibility menus nobody can find, and asking disabled players to “just practice”.