From 3f2779e790e461f9f3baeffc5f779fe50024eb10 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Thu, 3 Sep 2026 18:43:10 -0600 Subject: [PATCH] Fix CyberOverlay sweep and glitch bar x-offsets to use screen-space coor The overlay was drawing the sweep image and glitch burst bars at negative-x offsets (e.g. `-w/2`) as if in a centered coordinate system, but Phaser graphics/images live in scene space starting at 0. This shifted the sweep left by half the viewport and clipped the glitch bars off-screen. Anchor them to `0` / `w/2` so they align with the visible area. --- js/visuals/CyberOverlay.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/visuals/CyberOverlay.js b/js/visuals/CyberOverlay.js index c2ad8b5..ef980b4 100644 --- a/js/visuals/CyberOverlay.js +++ b/js/visuals/CyberOverlay.js @@ -110,7 +110,7 @@ export class CyberOverlay { const band = Math.max(20, Math.round(this.cfg.sweep.band)); this.sweepBand = band; this.sweep = scene - .add.image(0, 0, T.sweep) + .add.image(w / 2, 0, T.sweep) .setOrigin(0.5) .setScrollFactor(0) .setDepth(d + 2) @@ -223,14 +223,14 @@ export class CyberOverlay { const color = palette[(Math.random() * palette.length) | 0]; const alpha = 0.06 + Math.random() * 0.18; bars.fillStyle(color, alpha); - bars.fillRect(-w / 2 + dx - 24, y, w + 48, barH); + bars.fillRect(dx - 24, y, w + 48, barH); } // One wider "displacement band" so the burst reads at a glance. const bandY = Math.random() * h; bars.fillStyle(0x04060d, 0.55); - bars.fillRect(-w / 2 - 24, bandY, w + 48, 14 + Math.random() * 22); + bars.fillRect(-24, bandY, w + 48, 14 + Math.random() * 22); bars.fillStyle(0x00e5ff, 0.22); - bars.fillRect(-w / 2 - 24, bandY - 2, w + 48, 2); + bars.fillRect(-24, bandY - 2, w + 48, 2); const die = (this.lastTime ?? this.scene.time.now) + this.burstDur + 60; this.slices.push({ g: bars, die });