v0.2.0: item pickups hold their toast for 5.5s

Toast durations are now per-toast (addToast third arg); passive item and
active item pickups display for 5.5s instead of the default 2.5s.
Cache v=43.
This commit is contained in:
MeatSlicer Developer committed 2026-07-30 17:49:14 +10:00
1 parent 64ac53434b
commit 7d33e36c1e
8 files changed
+31 -31

No files matched your search

+2 -2
View File
@@ -198,7 +198,7 @@ function drawHUD(ctx) {
ctx.textAlign = 'center';
for (let i = 0; i < G.toasts.length; i++) {
const t = G.toasts[i];
const a = clamp(2.5 - t.t, 0, 1);
const a = clamp((t.dur || 2.5) - t.t, 0, 1);
const y = 22 + i * 48;
ctx.globalAlpha = a;
ctx.font = 'bold 13px monospace';
@@ -271,5 +271,5 @@ function drawMinimap(ctx) {
function drawToastsUpdate(dt) {
for (const t of G.toasts) t.t += dt;
while (G.toasts.length && G.toasts[0].t > 2.5) G.toasts.shift();
while (G.toasts.length && G.toasts[0].t > (G.toasts[0].dur || 2.5)) G.toasts.shift();
}