🔧 Jan 8 Fix EnhancedPrologueScene Syntax Error

 BUG FIX:
- Line 131: Comment and code on same line
- Wrong indentation in flyoverVoice.once callback
- Caused: SyntaxError: Unexpected token '}'

 SOLUTION:
- Separated comment to own line
- Fixed indentation (4 spaces)
- Node syntax check passes

 Game now loads without errors!
This commit is contained in:
2026-01-08 17:49:24 +01:00
parent d5b0046985
commit 640684e034

View File

@@ -128,227 +128,228 @@ class EnhancedPrologueScene extends Phaser.Scene {
this.showSubtitle("The Valley of Death is not just a place. It's a memory that no one wants to have anymore."); this.showSubtitle("The Valley of Death is not just a place. It's a memory that no one wants to have anymore.");
}); });
// After flyover, go to awakening flyoverVoice.once('complete', () => { // After flyover, go to awakening
this.time.delayedCall(1000, () => this.phase3_Awakening()); flyoverVoice.once('complete', () => {
}); this.time.delayedCall(1000, () => this.phase3_Awakening());
} });
}
phase3_Awakening() { phase3_Awakening() {
console.log('🎬 Phase 3: Kai Awakens'); console.log('🎬 Phase 3: Kai Awakens');
// PHASE 3: Awakening (1:00 - 1:30) // PHASE 3: Awakening (1:00 - 1:30)
this.clearSubtitle(); this.clearSubtitle();
// Fade in cellar background (blurred) // Fade in cellar background (blurred)
const cellar = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_cellar'); const cellar = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_cellar');
cellar.setAlpha(0); cellar.setAlpha(0);
this.backgroundLayer.add(cellar); this.backgroundLayer.add(cellar);
// Blur overlay // Blur overlay
const blur = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_blur'); const blur = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_blur');
blur.setAlpha(0); blur.setAlpha(0);
this.backgroundLayer.add(blur); this.backgroundLayer.add(blur);
// Fade out black, fade in cellar + blur // Fade out black, fade in cellar + blur
this.tweens.add({ this.tweens.add({
targets: this.blackScreen, targets: this.blackScreen,
alpha: 0, alpha: 0,
duration: 2000 duration: 2000
});
this.tweens.add({
targets: [cellar, blur],
alpha: 1,
duration: 3000,
ease: 'Sine.easeIn'
});
// Play awakening voice
this.time.delayedCall(2000, () => {
const awakeningVoice = this.sound.add('voice_awakening');
awakeningVoice.play();
this.showSubtitle("My head... it hurts. Where am I? Who am I...?");
// Clear blur gradually (vision clearing)
this.time.delayedCall(3000, () => {
this.tweens.add({
targets: blur,
alpha: 0,
duration: 4000,
ease: 'Sine.easeOut'
});
}); });
awakeningVoice.once('complete', () => { this.tweens.add({
this.time.delayedCall(1500, () => this.phase4_IDCard()); targets: [cellar, blur],
alpha: 1,
duration: 3000,
ease: 'Sine.easeIn'
}); });
});
}
phase4_IDCard() { // Play awakening voice
console.log('🎬 Phase 4: ID Card Discovery'); this.time.delayedCall(2000, () => {
const awakeningVoice = this.sound.add('voice_awakening');
awakeningVoice.play();
// PHASE 4: ID Card (1:30 - 2:30) this.showSubtitle("My head... it hurts. Where am I? Who am I...?");
this.clearSubtitle();
// Show ID card (zoom in effect) // Clear blur gradually (vision clearing)
const idCard = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_id_card'); this.time.delayedCall(3000, () => {
idCard.setScale(0.5); this.tweens.add({
idCard.setAlpha(0); targets: blur,
this.backgroundLayer.add(idCard); alpha: 0,
duration: 4000,
this.tweens.add({ ease: 'Sine.easeOut'
targets: idCard, });
alpha: 1,
scale: 1,
duration: 2000,
ease: 'Cubic.easeOut'
});
// Play truth voice
this.time.delayedCall(1500, () => {
const truthVoice = this.sound.add('voice_truth');
truthVoice.play();
this.showSubtitle("Kai Marković. 14 years old. That's me. But this other girl... why do I feel so empty?");
// Show twin photo (cross-fade)
this.time.delayedCall(8000, () => {
this.showSubtitle("Like I'm missing half of my heart.");
// Cross-fade to twin photo
const twinPhoto = this.add.image(
this.cameras.main.width / 2,
this.cameras.main.height / 2,
'intro_twin_photo'
);
twinPhoto.setAlpha(0);
twinPhoto.setScale(1.2);
this.backgroundLayer.add(twinPhoto);
// Fade out ID, fade in photo
this.tweens.add({
targets: idCard,
alpha: 0,
duration: 2000
}); });
this.tweens.add({ awakeningVoice.once('complete', () => {
targets: twinPhoto, this.time.delayedCall(1500, () => this.phase4_IDCard());
alpha: 1,
scale: 1,
duration: 3000,
ease: 'Sine.easeInOut'
}); });
}); });
}
truthVoice.once('complete', () => { phase4_IDCard() {
this.time.delayedCall(1000, () => this.phase5_Determination()); console.log('🎬 Phase 4: ID Card Discovery');
// PHASE 4: ID Card (1:30 - 2:30)
this.clearSubtitle();
// Show ID card (zoom in effect)
const idCard = this.add.image(this.cameras.main.width / 2, this.cameras.main.height / 2, 'intro_id_card');
idCard.setScale(0.5);
idCard.setAlpha(0);
this.backgroundLayer.add(idCard);
this.tweens.add({
targets: idCard,
alpha: 1,
scale: 1,
duration: 2000,
ease: 'Cubic.easeOut'
}); });
});
} // Play truth voice
this.time.delayedCall(1500, () => {
phase5_Determination() { const truthVoice = this.sound.add('voice_truth');
console.log('🎬 Phase 5: Determination + Quest'); truthVoice.play();
// PHASE 5: Determination (2:30 - 3:00) this.showSubtitle("Kai Marković. 14 years old. That's me. But this other girl... why do I feel so empty?");
this.clearSubtitle();
// Show twin photo (cross-fade)
const determinationVoice = this.sound.add('voice_determination'); this.time.delayedCall(8000, () => {
determinationVoice.play(); this.showSubtitle("Like I'm missing half of my heart.");
this.showSubtitle("Someone is waiting for me out there. I can't remember the face, but I feel the promise."); // Cross-fade to twin photo
const twinPhoto = this.add.image(
this.time.delayedCall(5000, () => { this.cameras.main.width / 2,
this.showSubtitle("I'm coming to find you... Ana."); this.cameras.main.height / 2,
'intro_twin_photo'
// Quest trigger flash );
this.cameras.main.flash(1000, 100, 50, 50); twinPhoto.setAlpha(0);
}); twinPhoto.setScale(1.2);
this.backgroundLayer.add(twinPhoto);
determinationVoice.once('complete', () => {
// Show quest notification // Fade out ID, fade in photo
this.showQuestNotification(); this.tweens.add({
targets: idCard,
// Fade to game after 3s alpha: 0,
this.time.delayedCall(3000, () => this.endIntro()); duration: 2000
}); });
}
this.tweens.add({
showQuestNotification() { targets: twinPhoto,
const { width, height } = this.cameras.main; alpha: 1,
scale: 1,
// Quest panel duration: 3000,
const questPanel = this.add.rectangle(width / 2, height / 2, 600, 200, 0x1a1a1a, 0.95); ease: 'Sine.easeInOut'
questPanel.setStrokeStyle(4, 0xffaa00); });
});
const questTitle = this.add.text(width / 2, height / 2 - 40, '📜 NEW QUEST', {
fontSize: '32px', truthVoice.once('complete', () => {
fontFamily: 'Georgia, serif', this.time.delayedCall(1000, () => this.phase5_Determination());
color: '#ffaa00', });
fontStyle: 'bold' });
}); }
questTitle.setOrigin(0.5);
phase5_Determination() {
const questText = this.add.text(width / 2, height / 2 + 20, 'Find clues about your past', { console.log('🎬 Phase 5: Determination + Quest');
fontSize: '20px',
fontFamily: 'Georgia, serif', // PHASE 5: Determination (2:30 - 3:00)
color: '#ffffff' this.clearSubtitle();
});
questText.setOrigin(0.5); const determinationVoice = this.sound.add('voice_determination');
determinationVoice.play();
this.uiLayer.add([questPanel, questTitle, questText]);
this.showSubtitle("Someone is waiting for me out there. I can't remember the face, but I feel the promise.");
// Pulse animation
this.tweens.add({ this.time.delayedCall(5000, () => {
targets: [questPanel, questTitle, questText], this.showSubtitle("I'm coming to find you... Ana.");
alpha: { from: 0, to: 1 },
scale: { from: 0.8, to: 1 }, // Quest trigger flash
duration: 800, this.cameras.main.flash(1000, 100, 50, 50);
ease: 'Back.easeOut' });
});
} determinationVoice.once('complete', () => {
// Show quest notification
showSubtitle(text) { this.showQuestNotification();
this.subtitleText.setText(text);
this.tweens.add({ // Fade to game after 3s
targets: this.subtitleText, this.time.delayedCall(3000, () => this.endIntro());
alpha: 1, });
duration: 500 }
});
} showQuestNotification() {
const { width, height } = this.cameras.main;
clearSubtitle() {
this.tweens.add({ // Quest panel
targets: this.subtitleText, const questPanel = this.add.rectangle(width / 2, height / 2, 600, 200, 0x1a1a1a, 0.95);
alpha: 0, questPanel.setStrokeStyle(4, 0xffaa00);
duration: 500,
onComplete: () => this.subtitleText.setText('') const questTitle = this.add.text(width / 2, height / 2 - 40, '📜 NEW QUEST', {
}); fontSize: '32px',
} fontFamily: 'Georgia, serif',
color: '#ffaa00',
skipIntro() { fontStyle: 'bold'
console.log('⏭️ Skipping intro...'); });
this.endIntro(); questTitle.setOrigin(0.5);
}
const questText = this.add.text(width / 2, height / 2 + 20, 'Find clues about your past', {
endIntro() { fontSize: '20px',
console.log('🎬 Intro complete! Launching GameScene...'); fontFamily: 'Georgia, serif',
color: '#ffffff'
// Fade out music });
this.tweens.add({ questText.setOrigin(0.5);
targets: this.noirMusic,
volume: 0, this.uiLayer.add([questPanel, questTitle, questText]);
duration: 2000,
onComplete: () => this.noirMusic.stop() // Pulse animation
}); this.tweens.add({
targets: [questPanel, questTitle, questText],
// Fade to black alpha: { from: 0, to: 1 },
this.cameras.main.fadeOut(2000, 0, 0, 0); scale: { from: 0.8, to: 1 },
duration: 800,
this.cameras.main.once('camerafadeoutcomplete', () => { ease: 'Back.easeOut'
this.scene.start('GameScene'); });
}); }
}
showSubtitle(text) {
this.subtitleText.setText(text);
this.tweens.add({
targets: this.subtitleText,
alpha: 1,
duration: 500
});
}
clearSubtitle() {
this.tweens.add({
targets: this.subtitleText,
alpha: 0,
duration: 500,
onComplete: () => this.subtitleText.setText('')
});
}
skipIntro() {
console.log('⏭️ Skipping intro...');
this.endIntro();
}
endIntro() {
console.log('🎬 Intro complete! Launching GameScene...');
// Fade out music
this.tweens.add({
targets: this.noirMusic,
volume: 0,
duration: 2000,
onComplete: () => this.noirMusic.stop()
});
// Fade to black
this.cameras.main.fadeOut(2000, 0, 0, 0);
this.cameras.main.once('camerafadeoutcomplete', () => {
this.scene.start('GameScene');
});
}
} }