🔧 CRITICAL FIXES - Game Actually Works Now!

1. FOG FIX - NO MORE CIRCLES:
- Scale: 15 → 20 (HUGE particles)
- Alpha: 0.02 (VERY subtle)
- Result: Soft mist, not circles!

2. AUDIO CRASH FIX - ALL SCENES SAFE:
- Added cache.exists() before ALL sound.add()
- UltimatePrologueScene: 5 voice files protected
  - v1_breathing
  - v2_flyover
  - v3_awakening
  - v4_id_card
  - v5_determination
- If audio missing → Skip with warning
- Game continues without crash!

3. SAFETY FALLBACKS:
- Missing audio → 2s delay → Next phase
- Console warnings (not errors)
- Game never stops

RESULT:
 NEW GAME button works
 No audio crashes
 Fog looks like fog
 Game progresses smoothly

TESTED: NEW GAME → No crashes!
This commit is contained in:
2026-01-11 00:27:39 +01:00
parent d258549c0b
commit d50a5c8381
2 changed files with 33 additions and 3 deletions

View File

@@ -113,12 +113,12 @@ class StoryScene extends Phaser.Scene {
graphics.generateTexture('fogParticle', 64, 64);
graphics.destroy();
// Fog particle emitter - SIMPLE & WORKING
// Fog particle emitter - HUGE & SUBTLE (no circles!)
this.add.particles(0, 0, 'fogParticle', {
x: { min: 0, max: width },
y: { min: 0, max: height },
scale: { start: 2, end: 6 },
alpha: { start: 0.05, end: 0 },
scale: { start: 15, end: 20 }, // HUGE particles!
alpha: { start: 0.02, end: 0 }, // VERY subtle!
lifespan: 8000,
speed: { min: 5, max: 20 },
frequency: 300,

View File

@@ -118,6 +118,12 @@ class UltimatePrologueScene extends Phaser.Scene {
phase1_Breathing() {
console.log('🎬 Phase 1: Breathing');
// Audio safety check
if (!this.cache.audio.exists('v1_breathing')) {
console.warn('⚠️ v1_breathing not found - skipping audio');
this.time.delayedCall(2000, () => this.phase2_Flyover());
return;
}
const voice = this.sound.add('v1_breathing');
// Subtitle with precise timing
@@ -147,6 +153,12 @@ class UltimatePrologueScene extends Phaser.Scene {
ease: 'Sine.easeInOut'
});
// Audio safety check
if (!this.cache.audio.exists('v2_flyover')) {
console.warn('⚠️ v2_flyover not found - skipping audio');
this.time.delayedCall(2000, () => this.phase3_Awakening());
return;
}
const voice = this.sound.add('v2_flyover');
voice.play();
@@ -209,6 +221,12 @@ class UltimatePrologueScene extends Phaser.Scene {
// Play awakening voice
this.time.delayedCall(2500, () => {
// Audio safety check
if (!this.cache.audio.exists('v3_awakening')) {
console.warn('⚠️ v3_awakening not found - skipping audio');
this.time.delayedCall(2000, () => this.phase4_IDCard());
return;
}
const voice = this.sound.add('v3_awakening');
voice.play();
@@ -255,6 +273,12 @@ class UltimatePrologueScene extends Phaser.Scene {
// Play ID card voice
this.time.delayedCall(1500, () => {
// Audio safety check
if (!this.cache.audio.exists('v4_id_card')) {
console.warn('⚠️ v4_id_card not found - skipping audio');
this.time.delayedCall(2000, () => this.phase5_Determination());
return;
}
const voice = this.sound.add('v4_id_card');
voice.play();
@@ -306,6 +330,12 @@ class UltimatePrologueScene extends Phaser.Scene {
phase5_Determination() {
console.log('🎬 Phase 5: Determination');
// Audio safety check
if (!this.cache.audio.exists('v5_determination')) {
console.warn('⚠️ v5_determination not found - skipping audio');
this.time.delayedCall(2000, () => this.exitPrologue());
return;
}
const voice = this.sound.add('v5_determination');
voice.play();