Il libro col 42 su una panca della Pieve (dentro la domanda); il cancello verde del tennis è dietro l'albero; i primi piani sopra al buio
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApqNBvNbNCwXqR2RLo8QJh
This commit is contained in:
@@ -21,7 +21,7 @@ function drawShape(ctx, s) {
|
||||
else for (let y = y0; y <= y1; y += step) ctx.fillRect(x0, y, x1 - x0, 1);
|
||||
} else if (s.text) {
|
||||
ctx.fillStyle = s.fill;
|
||||
ctx.font = 'bold 11px monospace';
|
||||
ctx.font = s.size ? `${s.size}px "Press Start 2P", monospace` : 'bold 11px monospace';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(s.text, ...s.at);
|
||||
@@ -147,7 +147,9 @@ export function render(ctx, game, { hover, spots, debug, time = performance.now(
|
||||
if (bg) ctx.drawImage(bg, 0, 0, WIDTH, HEIGHT);
|
||||
for (const shape of scene.art ?? []) drawShape(ctx, shape);
|
||||
// Una forma può avere la sua condizione (`when`): la chiavetta nella griglia sparisce quando la si prende.
|
||||
for (const h of game.hotspots()) for (const shape of h.art ?? []) if (check(shape.when, game.state)) drawShape(ctx, shape);
|
||||
// I primi piani (`top`) invece vanno sopra a tutto, anche al buio e alle candele: si disegnano dopo.
|
||||
const art = game.hotspots().flatMap(h => (h.art ?? []).filter(shape => check(shape.when, game.state)));
|
||||
for (const shape of art) if (!shape.top) drawShape(ctx, shape);
|
||||
// Andrea e i personaggi della scena, dal più lontano al più vicino.
|
||||
const andrea = sprites.get('andrea');
|
||||
const drawAndreaNow = () => andrea ? drawSprite(ctx, andrea, game.pose(), s.x, s.y, game.scaleAt(s.y), s.facing)
|
||||
@@ -159,6 +161,7 @@ export function render(ctx, game, { hover, spots, debug, time = performance.now(
|
||||
}
|
||||
for (const q of queue.sort((a, b) => a.y - b.y)) q.draw();
|
||||
drawLights(ctx, scene, time);
|
||||
for (const shape of art) if (shape.top) drawShape(ctx, shape);
|
||||
if (spots) drawSpots(ctx, game);
|
||||
if (debug) drawDebug(ctx, game, debug);
|
||||
if (hover) {
|
||||
|
||||
Reference in New Issue
Block a user