Isle-Slingers/js/app/agents.md

18 lines
958 B
Markdown
Raw Normal View History

# js/app/ — agents.md
Part of the modularization pass. Module map: `MODULES.md`; runtime model: `architecture.md`.
Self-contained module — the page. Owns DOM, input, screens and the main loop.
- Reads `window.ISLE_CORE`, `ISLE_LEVELS`, `ISLE_RENDERER`, `ISLE_AUDIO`; writes
`window.ISLE_PAGE = { getState }` for tests.
- Fixed-timestep loop: rAF accumulator at 1/120 s feeding `ISLE_CORE.step`;
`pumpFrames` in the page test drives it.
- Pointer model: mousedown near the sling arms aim, mousemove drags, mouseup
calls `ISLE_CORE.launch` with `aimVector(...)`; tap mid-flight =
`triggerAbility`. The direction test (bug #15) asserts pulling back launches
TOWARD the fort.
- Screens: start / level-select / pause / win / lose; HUD (level, birds, score,
pause, mute). Level select unlocks by localStorage progress.
- Keep DOM touches in this file only — physics/levels/audio/render must stay
DOM-free so the headless suites keep working.