diff --git a/packages/web/src/Replay.svelte b/packages/web/src/Replay.svelte index 401827b..02e2eb3 100644 --- a/packages/web/src/Replay.svelte +++ b/packages/web/src/Replay.svelte @@ -220,7 +220,10 @@ })(); let targetFacing = camF; let aimed = false; - if (dist > 0.05 && !hurled) { targetFacing = Math.atan2(dy, dx); aimed = true; } + // A stride turns the eyes along it — but only a REAL stride: on the + // reel's first run the camera sits at its uninitialized origin, and + // that phantom distance must not pick the opening shot's direction. + if (camReady && dist > 0.05 && !hurled) { targetFacing = Math.atan2(dy, dx); aimed = true; } else if (aim) { targetFacing = Math.atan2(aim.y + 0.5 - ty, aim.x + 0.5 - tx); aimed = true; @@ -236,9 +239,10 @@ aimed = true; } } - if (!camReady && !aimed) { - // The reel opens on a wizard standing still: face the longest - // corridor rather than whatever wall the default heading found. + if (!aimed && castRay(v, tx, ty, targetFacing).dist < 0.8) { + // Nothing aims the eyes and they'd idle nose-to-brick (the opening + // cut, or a beat after pacing into a dead end): face the deepest + // corridor from where the wizard stands instead. let deepest = -1; for (const a of [0, Math.PI / 2, Math.PI, -Math.PI / 2]) { const h = castRay(v, tx, ty, a);