- commit
- 1981ad96212daa3008d63fed63b10dd7a4b77eeb
- parent
- 200d50d5dbf50de4413185b46e93120e89b888ae
- author
- Dami <dami.etoile@gmail.com>
| A | openspec/ | 2 | ++ |
| A | openspec/ | 27 | ++++++++++++++++++++++++++ |
| A | openspec/ | 22 | +++++++++++++++++++++ |
| A | openspec/ | 16 | +++++++++++++++ |
| A | openspec/ | 31 | ++++++++++++++++++++++++++++++ |
| A | openspec/ | 26 | +++++++++++++++++++++++++ |
@@ -0,0 +1,27 @@
1+## Context2+3+The engine already emits settled turns and the presentation layer owns visual effects. D22 in `docs/design.md` defines timing and ordering. Current `src/stage.js` reads `performance.now()` directly, and several visual effects use requestAnimationFrame or timers independently. Input has its own repeat clock. Win and Pause draw through `src/render/stage-overlays.js`.4+5+## Decisions6+7+### Keep a presentation clock separate from simulation8+9+Parse `?slowmo=N` once, accept a finite positive review factor, and expose virtual `now`, animation-frame timestamps, and presentation delays. A factor of eight means 800ms of wall time advances a 100ms visual beat. Do not change engine steps, solver behavior, or the input adapter's held-direction repeat periods. Reduced motion resolves the end state immediately even when slow motion is enabled.10+11+### Use explicit scene phases12+13+Pause entry, active navigation, select, and exit are distinct phases. An exit captures its target action and rejects additional input until its reverse-stagger and shutter complete. Sound and music toggles press and update in place. Back uses the same exit without a press. Win has entrance, settled, and exit phases; its first Enter during entrance settles the card, and a later Enter exits to INDEX. Undo and replay remain available with their current semantics.14+15+### Derive visuals from settled events16+17+The winning cell comes from the settled event/board frame, not a guessed grid location. Word skid uses an actual pushed-word movement. Ledger entering/leaving spans use their physical sentence IDs. Step roll compares consecutive settled move counts and rolls down on Undo. These effects never change simulation state or hit geometry.18+19+### Test state and visual timing separately20+21+Pure phase/timing helpers get deterministic tests. Browser tests exercise input rejection during exit, skip-then-continue, reduced motion, and representative intermediate frames under `?slowmo=8`. Final settled frames retain legible copy and touch targets.22+23+## Risks24+25+- Overlapping timelines may leave hidden controls or stale frames. Every scene transition cancels its prior presentation generation and renders the new settled state.26+- Slow-motion may accidentally delay gameplay. The presentation clock is used only by visual effects and action exits that intentionally wait for an animation.27+- The menu and Win changes share stage plumbing. Integrate their small modules sequentially, then run full scene and share flows before publishing.@@ -0,0 +1,22 @@
1+## Why2+3+The current full-screen stage renders several overlay and HUD changes on a single frame. The designer's D22 motion contract gives those changes a physical timing language and a slow-motion review mode. The stage needs that choreography without delaying simulation turns or making reduced-motion controls harder to use.4+5+## What Changes6+7+- Add one presentation clock for `?slowmo=N`, including animation frames and presentation timers, while keeping engine turns and input ownership independent of animation time.8+- Animate Pause menu entry, selection, navigation, and exit with a shutter, typed title, staggered drops, a sliding highlight, and locked input during exit. Apply the shared menu behavior to other menu scenes where their controls permit it.9+- Animate the Win card as a winning-cell ring, delayed slam, sentence tile stamps, bar draw, count-up, action reveal, and explicit skip/exit sequence.10+- Give keycaps, the step counter, ledger sentences, and pushed words the D22 press, roll, stamp/exit, and skid feedback.11+- Preserve static end states under reduced motion and expose reviewable timing without changing rule semantics, mod data, or grid coordinates.12+13+## Capabilities14+15+### Modified Capabilities16+17+- `game-stage`: scene and input choreography.18+- `game-presentation`: HUD, sentence, and entity feedback timing.19+20+## Impact21+22+Stage overlays and scene dispatch, presentation timing, HUD/board/juice projections, focused tests, and browser visual review. Designer-owned `docs/design.md` and `docs/design.html` remain the reference and are not changed here.@@ -0,0 +1,16 @@
1+## MODIFIED Requirements2+3+### Requirement: The app SHALL show active rules and turn feedback4+The presentation SHALL render the current proof HUD, ledger, hints, keycap controls, active/inactive words, and no-YOU state on the stage. It SHALL consume settled engine events for blocked movement, undo, reset, transformations, defeat, victory, and rule changes without changing simulation state. New ledger sentences SHALL stamp tile by tile; broken sentences SHALL strike and fall away. Changed step digits SHALL roll up on forward counts and down on Undo. Pushed word tiles SHALL skid toward actual travel, while pushers remain level. Visible keycaps SHALL press when their corresponding keyboard, gamepad, or touch action fires.5+6+#### Scenario: A pushed word skids independently of its pusher7+- **WHEN** a settled accepted turn records a word moved with non-null `pushedBy`8+- **THEN** the word tilts toward its travel during its visual tween and rests level at the destination, while the pusher does not tilt9+10+#### Scenario: Undo rolls the step counter downward11+- **WHEN** Undo restores an earlier move count12+- **THEN** the clipped digits roll toward the lower number and settle on the restored count13+14+#### Scenario: New and broken sentences have distinct motion15+- **WHEN** a word push forms one sentence and breaks another16+- **THEN** the new physical sentence's tiles stamp in sequence and the broken sentence strikes, drops, and leaves without altering the engine's rule list@@ -0,0 +1,31 @@
1+## MODIFIED Requirements2+3+### Requirement: The stage SHALL provide the v0.3 scene flow4+The stage SHALL support Title, INDEX, Proof, Pause, Win card, Workshop, and pending Gift scenes. Scene changes SHALL be driven by explicit input and SHALL use a cat-centered iris transition, with a straight cut under reduced motion. A win SHALL wait for explicit continue or replay input. Pause and other menu overlays SHALL use the D22 entry, navigation, and exit phases; the Win card SHALL use the D22 ring and card choreography. `?slowmo=N` SHALL scale presentation timing for review without changing engine turns or held-input repeat cadence.5+6+#### Scenario: Pause enters and exits before its action7+- **WHEN** the player opens Pause and then selects a non-toggle action8+- **THEN** the shutter, title, and staggered items enter in order; the selected item presses, items leave in reverse order, the shutter closes, and the action runs after the exit9+10+#### Scenario: Repeated input during menu exit is ignored11+- **WHEN** a second key or tap arrives while Pause is exiting12+- **THEN** only the first captured action runs and navigation does not resume until the destination scene is ready13+14+#### Scenario: Toggle remains in Pause15+- **WHEN** the player selects Sound or Music16+- **THEN** that item presses and updates in place while Pause remains open17+18+#### Scenario: Win entrance can be skipped19+- **WHEN** the player presses Enter before the Win card has settled20+- **THEN** the entire card reaches its final legible state; a later Enter exits to INDEX21+22+#### Scenario: Reduced motion uses settled scenes23+- **WHEN** reduced motion is requested24+- **THEN** Pause and Win controls and text are immediately visible in their final positions without waiting for choreography25+26+### Requirement: Input SHALL be immediate, repeatable, and never queued27+The stage SHALL use the shared input adapter for keyboard, Standard gamepad, and touch. A press SHALL emit on the same frame, browser repeat events SHALL be ignored, only the most recently held direction SHALL repeat after 175ms and every 110ms, undo SHALL accelerate from 240ms toward a 55ms floor, and a new gameplay intent SHALL snap an in-flight visual tween before starting the next action. A menu exit SHALL capture one selected action and ignore later menu intents until the exit completes; this is an explicit scene phase, not a gameplay input queue.28+29+#### Scenario: Slow-motion review preserves input cadence30+- **WHEN** `?slowmo=8` is enabled and Right is held during a proof31+- **THEN** the engine accepts the same immediate and repeated movement cadence while presentation effects advance at one eighth visual speed@@ -0,0 +1,26 @@
1+## 1. Presentation clock and reusable motion2+3+- [ ] 1.1 Add bounded `?slowmo=N` presentation clock with deterministic tests for `now`, frame timestamps, and delayed actions; preserve input repeat timing and reduced-motion end states.4+- [ ] 1.2 Define reusable easing, phase, and primitive helpers without growing the stage shell into a god file.5+6+## 2. Menu choreography7+8+- [ ] 2.1 Animate Pause entry: 140ms shutter, typed title, 35ms staggered 200ms item drops at a 14px row gap, then hint/keycaps.9+- [ ] 2.2 Slide the solid highlight with a paw arc, press selections, reverse-stagger exit, and reject input until the captured exit action runs; toggles stay open.10+- [ ] 2.3 Apply coherent entry/exit feedback to other menu scenes without changing navigation or pointer hit targets.11+12+## 3. Win choreography13+14+- [ ] 3.1 Ring the actual winning cell, then slam the card at +260ms; stamp sentence tiles, draw the bar, count steps, and reveal actions in the documented order.15+- [ ] 3.2 First Enter during entrance skips to the settled card; the next Enter exits before INDEX. Undo and replay remain usable.16+17+## 4. In-play motion18+19+- [ ] 4.1 Press action keycaps for their keyboard, pad, and touch intents.20+- [ ] 4.2 Roll changed step digits up or down; stamp new ledger tiles and strike/exit removed sentences.21+- [ ] 4.3 Skid only pushed word tiles in the direction of travel.22+23+## 5. Acceptance24+25+- [ ] 5.1 Pass focused timing and input tests, full Node suite, production build, and strict OpenSpec validation.26+- [ ] 5.2 Review desktop/mobile intermediate and settled frames with the designer under `?slowmo=8`, plus reduced motion and public browser scene flow before publishing.