diff --git a/tools/smoke-actor.mjs b/tools/smoke-actor.mjs index 91081de2..79841a18 100644 --- a/tools/smoke-actor.mjs +++ b/tools/smoke-actor.mjs @@ -38,7 +38,21 @@ const walkOf = (e) => const rowOfFrame = (texture) => Number(String(texture).split('-')[1]); await runChecks({ projectId, baseUrl, port: 9341, shotPrefix: 'gm-actor' }, async (t) => { - const { check, sleep, json, shot, entity, play, stop, navigate, exceptions, holdKey, keyDown, keyUp } = t; + const { + check, + sleep, + json, + evaluate, + shot, + entity, + play, + stop, + navigate, + exceptions, + holdKey, + keyDown, + keyUp, + } = t; await navigate(); @@ -257,10 +271,13 @@ await runChecks({ projectId, baseUrl, port: 9341, shotPrefix: 'gm-actor' }, asyn // 12. A frame's top edge shows nothing of the cell above it, wherever the edge lands inside a // pixel. Drawn from the sheet, a partly covered edge pixel read the boots of the cell above – // the hairline over the head. Nudged upwards until the edge sits in the lower half of a pixel. + // At the game view's 100% a frame at full speed moves 2.5 px, so the edge only ever lands on + // .0 or .5. Slowed to 0.2 px a frame, it walks through every part of a pixel. const topEdge = async () => { const r = await json(`__gm.gameRect('oplayer')`); return { cx: Math.round(r.x), y0: r.y - r.h / 2 }; }; + await evaluate('__gm.setTimeScale(0.08)'); let edge; let nudges = 0; do { @@ -269,6 +286,7 @@ await runChecks({ projectId, baseUrl, port: 9341, shotPrefix: 'gm-actor' }, asyn edge = await topEdge(); nudges += 1; } while (nudges < 40 && !(edge.y0 % 1 > 0.6 && edge.y0 % 1 < 0.9)); + await evaluate('__gm.setTimeScale(1)'); const facingUp = await entity('oplayer'); const rowAt = async (y) => json(`[-8,-6,-4,-2,0,2,4,6,8].map((dx) => __gm.pixelAt(${edge.cx} + dx, ${y}))`).then((p) => p.join(' '));