P6.3: per-gem idle/select/land/clear animations (sx, iOS sim)
New gem_anim.sx adds a purely-visual per-gem pose set driven by a single animation clock: a calm always-on idle breath (scale-pulse + bob, per-gem phase, ramped in from rest), a selection pop, a landing squash-bounce, and a clear pop. BoardView draws every settled gem through gem_pose_at / gem_pose_frame; the move timeline (P6.1) and FX (P6.2) are untouched and the input-lock semantics are unchanged (idle never locks input). Determinism: the idle is always-on, so main reads M3TE_ANIM_TIME=<seconds> to freeze the clock at a chosen phase (t==0 == the resting board, so the pre-P6.3 goldens reproduce) and M3TE_SELECT=<cellIndex> to force a selection for capture. tests/gem_pose.sx locks the t==0-rest invariant and the reaction envelopes headlessly (fails if the idle ramp is dropped). Goldens (deterministic capture): p6_idle_t0 (resting), p6_idle_mid (pinned mid-breath), p6_select (selection pop on cell 3,3). Purely visual: no change to model/score/moves/hit-testing.
This commit is contained in:
27
README.md
27
README.md
@@ -57,3 +57,30 @@ The screenshot should match `goldens/p0_quad.png` (a centered orange quad over a
|
||||
blue clear), modulo the status-bar clock — pixel-exact equality is not required.
|
||||
A tap on the quad flips its color (orange ↔ green); see
|
||||
`goldens/p0_input_before.png` / `goldens/p0_input_after.png`.
|
||||
|
||||
### Deterministic animation capture (P6.3)
|
||||
|
||||
The per-gem idle loop (`gem_anim.sx`) is always-on, so a plain screenshot is
|
||||
time-dependent. Two environment variables pin the visual state so the board can
|
||||
be captured reproducibly. The simulator forwards any `SIMCTL_CHILD_*` variable to
|
||||
the launched app, so prefix them on the `simctl launch`:
|
||||
|
||||
- `M3TE_ANIM_TIME=<seconds>` freezes the animation clock at that phase. **`t=0`
|
||||
is the resting board** — every gem sits at its static pose, so the pre-P6.3
|
||||
goldens reproduce unchanged. A larger `t` (e.g. `1.0`) shows the mid-breath
|
||||
idle deformation. The select/land reactions read this same pinned phase.
|
||||
- `M3TE_SELECT=<cellIndex 0..63>` (= `row*8 + col`) force-selects a cell at
|
||||
startup, so the selection highlight + pop can be captured without a tap.
|
||||
|
||||
```bash
|
||||
# Resting board (idle at rest): goldens/p6_idle_t0.png
|
||||
SIMCTL_CHILD_M3TE_ANIM_TIME=0 xcrun simctl launch booted co.swipelab.m3te
|
||||
# Mid-breath idle: goldens/p6_idle_mid.png
|
||||
SIMCTL_CHILD_M3TE_ANIM_TIME=1.0 xcrun simctl launch booted co.swipelab.m3te
|
||||
# Selection pop on cell (3,3): goldens/p6_select.png
|
||||
env SIMCTL_CHILD_M3TE_ANIM_TIME=0.17 SIMCTL_CHILD_M3TE_SELECT=27 \
|
||||
xcrun simctl launch booted co.swipelab.m3te
|
||||
```
|
||||
|
||||
With no variable set the game runs fully live (the clock advances by
|
||||
`delta_time`). `tests/gem_pose.sx` locks the `t==0`-rest invariant headlessly.
|
||||
|
||||
Reference in New Issue
Block a user