From a5f9ac841f40c049a76003e6bb9904416edc996f Mon Sep 17 00:00:00 2001 From: Mk Date: Tue, 26 May 2026 18:16:58 +0000 Subject: [PATCH] fix: subtle torch/campfire flicker, stable warm glow overlay --- game.js | 12 ++++++------ index.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/game.js b/game.js index c0aa49d..51dabd5 100644 --- a/game.js +++ b/game.js @@ -3862,7 +3862,7 @@ registerProcessor('voice-playback', VoicePlaybackProcessor); function drawFire(wx,wy,now){ const baseX = wx; const baseY = wy; - const flick = 6 + (Math.sin(now/90)+1)*4; + const flick = 1.5 + (Math.sin(now/200)+1)*1; ctx.fillStyle = 'rgba(255,140,0,0.85)'; ctx.beginPath(); ctx.moveTo(baseX+10, baseY+30); @@ -4962,7 +4962,7 @@ registerProcessor('voice-playback', VoicePlaybackProcessor); // Функция: рисуем мягкий луч света с затуханием за стенами function castLight(sx, sy, radius) { - const flick = 0.92 + Math.sin(now/80 + sx*0.01)*0.04 + Math.sin(now/130 + sy*0.02)*0.04; + const flick = 0.97 + Math.sin(now/300 + sx*0.01)*0.015 + Math.sin(now/470 + sy*0.02)*0.015; const r = radius * flick; // 24 луча — мягкий круглый свет const steps = 24; @@ -5032,13 +5032,13 @@ registerProcessor('voice-playback', VoicePlaybackProcessor); if(b.gx < minGX-3 || b.gx > maxGX+3 || b.gy < minGY-3 || b.gy > maxGY+3) continue; const def = BLOCKS[b.t]; if(def.lightRadius){ - const flick = 0.7 + Math.sin(now/90 + b.gx*3.7)*0.15 + Math.sin(now/140 + b.gy*2.3)*0.15; + const flick = 0.9 + Math.sin(now/350 + b.gx*3.7)*0.05 + Math.sin(now/530 + b.gy*2.3)*0.05; const wx = b.gx*TILE + TILE/2 - camX; const wy = b.gy*TILE + TILE/2 - camY; - const r = def.lightRadius * 0.75 * flick; + const r = def.lightRadius * 0.85; const grad = ctx.createRadialGradient(wx,wy, 0, wx,wy, r); - grad.addColorStop(0, `rgba(255,180,80,${0.22*flick})`); - grad.addColorStop(0.5, `rgba(255,140,40,${0.10*flick})`); + grad.addColorStop(0, `rgba(255,180,80,0.28)`); + grad.addColorStop(0.5, `rgba(255,140,40,0.13)`); grad.addColorStop(1, 'rgba(255,100,20,0)'); ctx.fillStyle = grad; ctx.beginPath(); diff --git a/index.html b/index.html index 12dc1dc..7f7425c 100644 --- a/index.html +++ b/index.html @@ -94,6 +94,6 @@ - +