Macchinine: si sceglie la macchinina, la forza sale da zero tenendo premuto e la spinta parte lasciando; il saluto col Chiaru («un girino alle case rosse» / «Vorrai dire un giochino!» / «Ciao Mattè»), «Si fa una gara alle macchinine?!?!», Andrea chiama Bertovo «Fabri»; musica del GP in prestito (Andrea)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiECd9KMfjthRUnujCGSzZ
This commit is contained in:
+16
-4
@@ -34,19 +34,31 @@ try {
|
||||
await page.evaluate(async () => {
|
||||
const { settle } = await import('/tests/helpers.mjs');
|
||||
game.act('talk', 'chiaru'); settle(game);
|
||||
game.choose(game.options().findIndex(o => o.text === 'Si corre?')); settle(game);
|
||||
game.choose(game.options().findIndex(o => o.text === 'Si fa una gara alle macchinine?!?!')); settle(game);
|
||||
game.choose(game.options().findIndex(o => o.text === 'Alla bona.')); settle(game);
|
||||
});
|
||||
await page.waitForSelector('#bocce-controls:not([hidden])');
|
||||
await page.waitForFunction(async () => {
|
||||
const { hasBackground } = await import('/src/engine/render.js');
|
||||
return hasBackground('assets/closeups/micro-parcheggio.png') && hasBackground('assets/closeups/micro/rossa.png');
|
||||
return hasBackground('assets/closeups/micro-parcheggio.png');
|
||||
});
|
||||
assert.equal(await page.locator('#bocce-throw').textContent(), 'Spingi');
|
||||
// Prima si sceglie la macchinina: la viola, toccandola.
|
||||
assert.equal(await page.locator('#bocce-throw').textContent(), 'Scegli');
|
||||
await page.waitForFunction(async () => (await import('/src/engine/render.js')).hasBackground('assets/closeups/micro/viola-grande.png'));
|
||||
if (name === 'desktop') { await page.waitForTimeout(1600); await page.screenshot({ path: `${out}/${name}-sceglie.png` }); }
|
||||
{
|
||||
const box = await page.locator('#scene').boundingBox(), [vx, vy] = [480, 220];
|
||||
const at = { x: box.x + vx / 640 * box.width, y: box.y + vy / 360 * box.height };
|
||||
if (mobile) await page.touchscreen.tap(at.x, at.y); else await page.mouse.click(at.x, at.y);
|
||||
}
|
||||
assert.deepEqual(await page.evaluate(() => game.closeup.colors), { player: 'viola', cpu: 'blu' });
|
||||
await page.waitForTimeout(1600);
|
||||
if (name === 'desktop') await page.screenshot({ path: `${out}/${name}-scelta.png` });
|
||||
await page.waitForFunction(() => document.querySelector('#bocce-throw').textContent === 'Spingi');
|
||||
assert.ok(await page.locator('#micro-help').isVisible(), 'il «Come si gioca» delle macchinine');
|
||||
const exit = await page.locator('#closeup-close').boundingBox(), canvas = await page.locator('#scene').boundingBox();
|
||||
assert.ok(exit.y >= canvas.y + canvas.height, 'l\'uscita sta fuori dalla pista');
|
||||
await page.waitForTimeout(1600);
|
||||
await page.waitForFunction(async () => (await import('/src/engine/render.js')).hasBackground('assets/closeups/micro/viola.png'));
|
||||
const state = () => page.evaluate(() => ({ angle: game.closeup.angle, power: game.closeup.power, step: game.closeup.step, x: game.closeup.cars.player.x }));
|
||||
// Un punto della pista davanti alla macchinina di Andrea, in pixel della pagina.
|
||||
const ahead = await page.evaluate(() => { const c = game.closeup, i = (c.cars.player.idx + 50) % c.track.n; return c.track.pts[i]; });
|
||||
|
||||
Reference in New Issue
Block a user