Biliardo dell'Ing. Tozzi: il tiro pieno va più forte (720 cm/s; i rinquarti restano a 520) e il test nel browser segue i comandi nuovi (Andrea)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiECdCPptNRwbVzjzHbohi
This commit is contained in:
2026-10-29 00:11:02 +01:00
co-authored by Claude Opus 5.5
parent a11a6ef59f
commit 381254ed4d
4 changed files with 21 additions and 12 deletions
+6 -3
View File
@@ -128,11 +128,13 @@ try {
const fixed = (await state()).angle;
await page.mouse.move(target.r.x + target.r.width * 0.55, target.r.y + target.r.height * 0.8, { steps: 8 });
assert.equal((await state()).angle, fixed, 'spostarsi verso Tira non deve cambiare la mira');
// Le frecce girano finché sono giù (sempre più svelte); un colpo secco è un passo, con Maiusc un passo fine.
await page.keyboard.press('ArrowRight');
const nudged = (await state()).angle;
assert.ok(Math.abs(nudged - fixed - 0.002) < 1e-10);
assert.ok(nudged - fixed >= 0.03 - 1e-9 && nudged - fixed < 0.1, `passo: ${nudged - fixed}`);
await page.keyboard.press('Shift+ArrowLeft');
assert.ok(Math.abs((await state()).angle - nudged + 0.0005) < 1e-10);
const fine = nudged - (await state()).angle;
assert.ok(fine >= 0.0005 - 1e-9 && fine < 0.01, `passo fine: ${fine}`);
await page.locator('#bocce-power').fill('60');
const prepared = await state();
await page.screenshot({ path: `${out}/${name}-mira.png` });
@@ -158,7 +160,8 @@ try {
const cdp = mobile ? await page.context().newCDPSession(page) : null;
if (mobile) await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: [{ x: hold.x, y: hold.y }] });
else { await page.mouse.move(hold.x, hold.y); await page.mouse.down(); }
await page.waitForFunction(() => game.closeup.holding && game.closeup.power > 0.25);
// Si tiene premuto: dopo LONG_PRESS la stecca comincia a caricare.
await page.waitForFunction(() => game.closeup.holding && game.closeup.charging);
const heldAngle = (await state()).angle;
if (mobile) await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints: [{ x: hold.x - 30, y: hold.y + 20 }] });
else await page.mouse.move(hold.x - 30, hold.y + 20, { steps: 4 });