From 78c93300aa2c68a6dc12cdce262dfbda611df7ea Mon Sep 17 00:00:00 2001 From: David Kotnik Date: Sat, 10 Jan 2026 13:35:04 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20FIX:=20Added=20missing=20functio?= =?UTF-8?q?ns=20for=20Polaroid+VHS!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ FIXED BUGS: - loadAudioSafe() function added - startAmbientAudio() function added - createVHSEffects() function added - All functions properly called in create() ✅ NOW READY TO TEST! Intro should work with Polaroid frames + VHS effects! --- src/scenes/IntroScene.js | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/scenes/IntroScene.js b/src/scenes/IntroScene.js index 09b5b1aa8..d90d6684b 100644 --- a/src/scenes/IntroScene.js +++ b/src/scenes/IntroScene.js @@ -52,12 +52,26 @@ class IntroScene extends Phaser.Scene { this.loadAudioSafe('audio_kai_memory_03', 'assets/audio/voiceover/kai_memory_03.mp3'); } + loadAudioSafe(key, path) { + try { + this.load.audio(key, path); + } catch (error) { + console.warn(`⚠️ Audio skipped: ${key} (file not found)`); + } + } + create() { console.log('🎬 IntroScene: Starting intro sequence...'); // Black background this.cameras.main.setBackgroundColor('#000000'); + // 🎵 Start ambient audio (if available) + this.startAmbientAudio(); + + // 📺 Create VHS overlay effects + this.createVHSEffects(); + // Setup input for skip this.setupSkipControls(); @@ -84,6 +98,62 @@ class IntroScene extends Phaser.Scene { }); } + startAmbientAudio() { + // Noir ambience (constant low drone) + try { + if (this.cache.audio.exists('noir_ambience')) { + this.ambientAudio = this.sound.add('noir_ambience', { volume: 0.15, loop: true }); + this.ambientAudio.play(); + } + } catch (e) { + console.warn('⚠️ Ambient audio not available'); + } + + // Projector sound (old film aesthetic) + try { + if (this.cache.audio.exists('projector_loop')) { + this.projectorAudio = this.sound.add('projector_loop', { volume: 0.2, loop: true }); + this.projectorAudio.play(); + } + } catch (e) { + console.warn('⚠️ Projector audio not available'); + } + } + + createVHSEffects() { + const width = this.cameras.main.width; + const height = this.cameras.main.height; + + // VHS Scanlines (horizontal lines) + this.scanlines = this.add.graphics(); + this.scanlines.setDepth(900); + + for (let y = 0; y < height; y += 4) { + this.scanlines.fillStyle(0x000000, 0.15); + this.scanlines.fillRect(0, y, width, 2); + } + + // VHS Noise overlay (subtle static) + this.vhsNoise = this.add.rectangle( + width / 2, + height / 2, + width, + height, + 0xffffff, + 0.03 + ); + this.vhsNoise.setDepth(901); + + // Animate noise (flicker) + this.tweens.add({ + targets: this.vhsNoise, + alpha: { from: 0.01, to: 0.05 }, + duration: 100, + yoyo: true, + repeat: -1 + }); + } + showSkipPrompt() { if (this.skipPrompt) return; // Already showing