P18.2: organic combine — staggered clear ripple (sx, iOS sim)
Within a clearing round the matched gems no longer all explode at once: each gem's pop (and its burst) START is offset by a bounded per-gem delay so the cells detonate as a ripple. - board_anim.sx: clear_ripple_t(t,u) mirrors fall_stagger_t's (t-delay)/window, delaying a gem's pop START by CLEAR_STAGGER_MAX*u (0.45 of the clear window). Bounded: every gem still reaches local 1 (scale 0) by t==1, so none is left mid-pop at the seam to the fall. clear_diag_span/clear_rank rank each matched gem 0..1 by diagonal (col+row) PER ROUND, so even a 3-match ripples across the full budget. - board_view.sx render_clear: feed each matched gem's ranked, staggered local t through the P18.1 clear_pop_scale (locked endpoints unchanged). - board_fx.sx: bursts carry the same per-gem delay so they ripple in lockstep with the pops. Per-round audio cue (P10.10) still fires once at t0, not per gem. - Model untouched (same cells cleared, same final board); CLEAR_ANIM_DUR fixed, so cascade-cue snapshots don't churn and M3TE_ANIM_TIME=0 still rests. - tests/easing.sx: pin clear_ripple_t endpoints, bounded completion by t==1, monotonicity, ripple ordering, and the diagonal rank. - goldens: add p18_stagger (M3TE_FX=3 @ 0.22); refresh p18_pop, p6_fx_match, p11_combo_deep (all pinned mid-clear, now showing the ripple).
This commit is contained in:
@@ -210,6 +210,57 @@ main :: () -> s32 {
|
||||
if !rlt_col_mono { fails += 1; }
|
||||
if !rlt_round_after { fails += 1; }
|
||||
|
||||
// 8. Per-gem clear ripple (P18.2): within a clearing round each matched gem's
|
||||
// pop START is offset by a BOUNDED delay (its rank u in [0,1] across the
|
||||
// round's matched cells) so the matched cells explode as a ripple, yet EVERY
|
||||
// gem still completes its pop by the segment end. Lock: at t==0 no rank has
|
||||
// started; at t==1 EVERY rank has reached local 1 (clear_pop_scale → scale 0,
|
||||
// fully cleared — no gem left mid-pop at the seam to the fall); per-rank local
|
||||
// progress is monotonic in t; and MID-clear a HIGHER rank has made STRICTLY
|
||||
// LESS progress than a lower one (its pop starts later) — the ripple, the
|
||||
// opposite of a flat simultaneous clear. `clear_rank` then ranks each matched
|
||||
// gem 0..1 by diagonal across the round (lowest-diagonal = 0, the first to pop).
|
||||
print("== clear ripple bounded ==\n");
|
||||
rip_t0 := true; rip_t1 := true;
|
||||
for 0..6: (j) {
|
||||
u := cast(f32) j / 5.0;
|
||||
if clear_ripple_t(0.0, u) != 0.0 { rip_t0 = false; }
|
||||
if clear_ripple_t(1.0, u) != 1.0 { rip_t1 = false; }
|
||||
}
|
||||
rip_ripple := true;
|
||||
for 1..6: (j) {
|
||||
u := cast(f32) j / 5.0;
|
||||
up := cast(f32) (j - 1) / 5.0;
|
||||
if !(clear_ripple_t(0.5, u) < clear_ripple_t(0.5, up)) { rip_ripple = false; }
|
||||
}
|
||||
rip_mono := true;
|
||||
for 0..6: (j) {
|
||||
u := cast(f32) j / 5.0;
|
||||
pp := clear_ripple_t(0.0, u);
|
||||
for 1..21: (i) {
|
||||
tt := cast(f32) i / 20.0;
|
||||
vv := clear_ripple_t(tt, u);
|
||||
if vv < pp - 0.000001 { rip_mono = false; }
|
||||
pp = vv;
|
||||
}
|
||||
}
|
||||
mm : MatchMask = ---;
|
||||
for 0..BOARD_CELLS: (i) { mm.cells[i] = false; }
|
||||
mm.cells[Board.idx(5, 0)] = true; // diagonal 5 — first to pop
|
||||
mm.cells[Board.idx(5, 1)] = true; // diagonal 6
|
||||
mm.cells[Board.idx(5, 2)] = true; // diagonal 7 — last to pop
|
||||
sp := clear_diag_span(@mm);
|
||||
rip_rank := approx(clear_rank(sp, 5, 0), 0.0)
|
||||
and approx(clear_rank(sp, 5, 1), 0.5)
|
||||
and approx(clear_rank(sp, 5, 2), 1.0);
|
||||
print("ripple_t0 {} ripple_t1 {} ripple_cascade {} ripple_mono {} ripple_rank {}\n",
|
||||
rip_t0, rip_t1, rip_ripple, rip_mono, rip_rank);
|
||||
if !rip_t0 { fails += 1; }
|
||||
if !rip_t1 { fails += 1; }
|
||||
if !rip_ripple { fails += 1; }
|
||||
if !rip_mono { fails += 1; }
|
||||
if !rip_rank { fails += 1; }
|
||||
|
||||
if fails == 0 {
|
||||
print("ok: easing toolkit endpoints locked + amplitudes bounded\n");
|
||||
return 0;
|
||||
|
||||
@@ -12,4 +12,6 @@ bounce_ends true peak_amp true peak_loc true overshoots true overshoot_bounded t
|
||||
stagger_t0 true stagger_t1 true stagger_cascade true stagger_mono true
|
||||
== landing instant ==
|
||||
landing_first true landing_last true landing_mono true landing_seam true landtime_col_mono true landtime_round_after true
|
||||
== clear ripple bounded ==
|
||||
ripple_t0 true ripple_t1 true ripple_cascade true ripple_mono true ripple_rank true
|
||||
ok: easing toolkit endpoints locked + amplitudes bounded
|
||||
|
||||
Reference in New Issue
Block a user