diff --git a/src/scenes/IntroScene.js b/src/scenes/IntroScene.js index 6320adb3a..8d631f3d7 100644 --- a/src/scenes/IntroScene.js +++ b/src/scenes/IntroScene.js @@ -448,21 +448,9 @@ class IntroScene extends Phaser.Scene { const duration = endTime - startTime; this.time.delayedCall(startTime, () => { - // Fade out previous polaroid - if (this.currentPolaroid) { - this.tweens.add({ - targets: this.currentPolaroid, - alpha: 0, - duration: 300, - onComplete: () => { - if (this.currentPolaroid) { - this.currentPolaroid.frame.destroy(); - this.currentPolaroid.photo.destroy(); - this.currentPolaroid = null; - } - } - }); - } + // CROSSFADE: Store old reference for simultaneous fade + const oldPolaroid = this.currentPolaroid; + // (Old will fade out WHILE new fades in - see below) // Create photo image (65% of screen) const photo = this.add.image(width / 2, height / 2 - 30, imageKey); @@ -524,47 +512,29 @@ class IntroScene extends Phaser.Scene { photo.setTint(0x66ff66); } - // FASTER FADE-IN (less black!) + // CROSSFADE: NEW fades IN (800ms) this.tweens.add({ targets: [photo, frame], - alpha: { from: 0, to: 1 }, - duration: 1000, // Was 2000 - now faster! + alpha: 1, + duration: 800, ease: 'Power2.easeOut' }); - // GLITCH-OUT transition (earlier start!) - this.time.delayedCall(duration - 300, () => { // Was 500 - now earlier! - if (this.currentPolaroid) { - // Frame fades first (faster!) - this.tweens.add({ - targets: frame, - alpha: 0, - duration: 50 // Was 100 - now faster! - }); + // SIMULTANEOUSLY: OLD fades OUT (same 800ms) + if (oldPolaroid) { + this.tweens.add({ + targets: [oldPolaroid.photo, oldPolaroid.frame], + alpha: 0, + duration: 800, // Same duration = perfect crossfade! + ease: 'Power2.easeIn', + onComplete: () => { + oldPolaroid.frame.destroy(); + oldPolaroid.photo.destroy(); + } + }); + } - // Photo glitches (faster!) - this.tweens.add({ - targets: photo, - x: { from: photo.x - 10, to: photo.x + 10 }, - duration: 30, // Was 50 - now faster! - repeat: 5, - yoyo: true, - onComplete: () => { - // RGB flash (faster!) - photo.setTint(0xff0000); - this.time.delayedCall(30, () => photo.setTint(0x00ff00)); // Was 50 - this.time.delayedCall(60, () => photo.setTint(0x0000ff)); // Was 100 - this.time.delayedCall(90, () => { // Was 150 - this.tweens.add({ - targets: photo, - alpha: 0, - duration: 100 // Was 200 - faster! - }); - }); - } - }); - } - }); + // OLD GLITCH-OUT removed - crossfade handles transitions now! if (options.glitch) { this.tweens.add({