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.
This commit is contained in:
Brian Fertig 2026-09-03 18:43:10 -06:00
parent 6ba71620b4
commit 3f2779e790
1 changed files with 4 additions and 4 deletions

View File

@ -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 });