La Smarronata piena di gente com'era: i volontari della Misericordia alle bruciate, la fanfara degli alpini, la polenta, il vino, la gente coi cartocci e le coppie del liscio; il fuoco vivo sotto il cilindro delle bruciate; nei Ringraziamenti la dedica allo zio Mario (Andrea)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
This commit is contained in:
@@ -351,6 +351,31 @@ export const EFFECTS = {
|
||||
ctx.fillRect(x0 + c, y0 + dy, 1, h);
|
||||
}
|
||||
},
|
||||
// Il fuoco di legna (il braciere delle bruciate alla Smarronata, Andrea 31 ottobre): lingue che guizzano a scatti
|
||||
// sulla base `area` [x, y, w, h], rosse fuori e gialle dentro, e un bagliore caldo che pulsa.
|
||||
fire(ctx, e, time) {
|
||||
const [x, y, w, h] = e.area, step = e.every ?? 110, n = Math.max(3, Math.round(w / 4));
|
||||
ctx.save();
|
||||
ctx.globalCompositeOperation = 'lighter';
|
||||
const g = ctx.createRadialGradient(x + w / 2, y + h / 2, 0, x + w / 2, y + h / 2, w * 0.9);
|
||||
g.addColorStop(0, `rgba(255, 140, 50, ${0.28 + 0.08 * Math.sin(time / 170)})`);
|
||||
g.addColorStop(1, 'rgba(255, 90, 30, 0)');
|
||||
ctx.fillStyle = g;
|
||||
ctx.fillRect(x - w, y - w, w * 3, w * 2.4);
|
||||
ctx.restore();
|
||||
// Ogni lingua: righe che si stringono salendo, gialla alla base, arancio a metà, rossa in punta, e ondeggia.
|
||||
for (let i = 0; i < n; i++) {
|
||||
const t = Math.floor(time / step) * 13 + i * 7, cx = x + (i + 0.5) * w / n;
|
||||
const tall = Math.round(h * (0.5 + 0.8 * hash(t))), base = y + h, lean = (hash(t + 1) - 0.5) * 3;
|
||||
for (let r = 0; r < tall; r++) {
|
||||
const k = r / tall, half = Math.max(0.5, 2.2 * (1 - k)), px = cx + lean * k;
|
||||
ctx.fillStyle = k < 0.3 ? '#ffe27a' : k < 0.65 ? '#ff9a2e' : '#d8401c';
|
||||
ctx.fillRect(Math.round(px - half), base - r - 1, Math.max(1, Math.round(half * 2)), 1);
|
||||
}
|
||||
// Una scintilla che sale, ogni tanto.
|
||||
if (hash(t + 3) < 0.25) { ctx.fillStyle = '#ffd25a'; ctx.fillRect(Math.round(cx + lean), base - tall - 2 - Math.round(hash(t + 9) * 5), 1, 1); }
|
||||
}
|
||||
},
|
||||
// Il fumo da un comignolo: sbuffi che salgono, crescono e svaniscono.
|
||||
smoke(ctx, e, time) {
|
||||
const [x, y] = e.at, life = 2600;
|
||||
|
||||
Reference in New Issue
Block a user