diff --git a/docs/superpowers/plans/2026-11-02-character-controls.md b/docs/superpowers/plans/2026-11-02-character-controls.md new file mode 100644 index 0000000..44a8459 --- /dev/null +++ b/docs/superpowers/plans/2026-11-02-character-controls.md @@ -0,0 +1,32 @@ +# Character controls and breathing implementation plan + +**Goal:** Keep tap-to-move without a joystick, independently orbit the camera and turn the character, select companions and stand beside them, and add subtle idle breathing. + +**Architecture:** Extend the existing pointer controller, third-person camera, sheep rig and remote-player collection. Keep movement constraints and the multiplayer position/yaw protocol. No dependencies or new input framework. + +**Spec:** User-approved conversation: tap ground to move, tap characters to select, drag to orbit without turning the character, pinch to zoom, explicit direction mode with Done, no automatic camera rotation during walking, companion side placement. Additional request: natural breathing while idle. + +## Constraints and review focus +- Feature settings belong in existing domain constants. Preserve PC right-click movement and left-click selection. +- Entering direction mode stops walking and cancels prayer; leaving restores orbit behavior. +- Pinch/cancel/blur must not become a tap or leave captured input active. +- Companion placement uses the nearest accessible side, existing travel checks and final facing; departure cancels selection. +- Breathing uses original transforms, keeps legs/root fixed, carries coat/head accessories, blends out for other actions, and invalidates rendering. + +## Tasks +- [x] Extend controller tests for direction mode, selection and multi-touch suppression; update camera test to require preserved orbit. Run focused tests to establish failures. +- [x] Implement input mode and zoom callbacks in `src/controls/fpsCameraController.ts`, camera distance and decoupled movement in `src/controls/thirdPersonCamera.ts`, settings in `src/constants/movement.ts` and `character.ts`. +- [x] Add companion picking/side destination with behavioral tests to `src/multiplayer/remotePlayers.ts`; connect compact controls and accessible state in `src/scene/world.ts`, `index.html`, `src/style.css`. +- [x] Test idle rig transforms, coat and clone independence in `tests/character.test.ts`; implement breathing in `src/scene/sheep.ts` and reuse in the lobby while preserving its gaze. +- [x] Run `npm test`, `npm run build`; inspect mobile UI and gesture behavior in a browser if available. Review diff and document limitations. + +Implementation proceeds in the current clean workspace under the user's explicit request. No commit, publication or dependency installation is needed. + +## Verification +- Focused input, rig, gear and companion tests passed. Tests first demonstrated missing direction mode, pinch/selection and breathing behavior. +- Review caught canvas blur no longer stopping travel; a failing behavior test was added and the existing stop-on-menu behavior restored. +- Production build passed (existing large-chunk warning remains). +- Headless Edge at 390px and 320px verified real touch orbit/body separation, pinch without movement, companion selection/arrival, breathing and layout; no page errors. +- Browser validation uses an injected companion in a solo scene; remote-player reconciliation and server behavior are covered separately by the test suite. +- Sandbox temp rename and localhost restrictions required running the full suite and browser with local permissions. No application workaround was introduced. +- Final full suite: 142 tests, 141 passed, 1 skipped, 0 failed. diff --git a/index.html b/index.html index 2a481a0..ba95e1b 100644 --- a/index.html +++ b/index.html @@ -87,6 +87,16 @@ +
+ + + +
@@ -153,7 +163,7 @@