feat: complete Style 32 overhaul & Tiled integration fix

- Enforced 'Style 32 - Dark Chibi Vector' for all ground assets.
- Fixed critical Prologue-to-Game crash (function renaming).
- Implemented Tiled JSON/TMX auto-conversion.
- Updated Asset Manager to visualize 1800+ assets.
- Cleaned up project structure (new assets/grounds folder).
- Auto-Ground logic added to GameScene.js.
This commit is contained in:
2026-01-11 20:08:56 +01:00
parent 16e4284964
commit 7264ec6fc0
97 changed files with 49754 additions and 690 deletions

View File

@@ -22,12 +22,11 @@ class StoryScene extends Phaser.Scene {
graphics.fillGradientStyle(0x1a0000, 0x1a0000, 0x000000, 0x000000, 1);
graphics.fillRect(0, 0, width, height);
// 🌫️ NOIR FOG EFFECT
// 🌫️ NOIR FOG EFFECT (Fixed per instructions)
this.createNoirFog(width, height);
// 🎵 NOIR BACKGROUND MUSIC (disabled temporarily)
// this.playNoirMusic();
console.log('🔇 Music disabled temporarily');
// 🎵 NOIR BACKGROUND MUSIC
this.playNoirMusic();
// MAIN TITLE (horizontal, top center)
@@ -113,16 +112,16 @@ class StoryScene extends Phaser.Scene {
graphics.generateTexture('fogParticle', 64, 64);
graphics.destroy();
// Fog particle emitter - HUGE & SUBTLE (no circles!)
// Fog particle emitter - FIXED PER USER REQUEST: Huge, slow, mist-like
this.add.particles(0, 0, 'fogParticle', {
x: { min: 0, max: width },
y: { min: 0, max: height },
scale: { start: 15, end: 20 }, // HUGE particles!
alpha: { start: 0.02, end: 0 }, // VERY subtle!
lifespan: 8000,
speed: { min: 5, max: 20 },
frequency: 300,
blendMode: 'NORMAL'
scale: { start: 15, end: 20 }, // HUGE particles! (15-20x)
alpha: { start: 0.02, end: 0 }, // VERY subtle! (0.02)
lifespan: 15000, // Slower (longer life)
speed: { min: 2, max: 10 }, // Slow movement
frequency: 500,
blendMode: 'ADD'
});
// NOIR VIGNETTE (dark edges)
@@ -141,57 +140,60 @@ class StoryScene extends Phaser.Scene {
playNoirMusic() {
// Play forest evening ambience (noir atmosphere)
const key = 'forest_ambient';
try {
if (this.sound.get('forest_ambient')) {
const music = this.sound.add('forest_ambient', {
volume: 0.3,
loop: true
});
music.play();
console.log('🎵 Noir atmosphere music playing at 30% volume');
// STRICT CHECK: Only play if audio exists in cache
if (this.cache.audio.exists(key)) {
// Prevent duplicate playback
// Get all playing sounds to check if already playing
let isPlaying = false;
if (this.sound.sounds) {
this.sound.sounds.forEach(s => {
if (s.key === key && s.isPlaying) isPlaying = true;
});
}
if (!isPlaying) {
this.sound.play(key, {
volume: 0.3,
loop: true
});
console.log('🎵 Noir atmosphere music playing at 30% volume');
}
} else {
console.warn('⚠️ forest_ambient not loaded yet - trying alternative');
// Try to load and play immediately
this.load.audio('forest_ambient', 'assets/audio/music/forest_ambient.mp3');
this.load.once('complete', () => {
try {
const music = this.sound.add('forest_ambient', { volume: 0.3, loop: true });
music.play();
console.log('🎵 Loaded and playing forest_ambient');
} catch (e) {
console.error('❌ Failed to play music:', e.message);
}
});
this.load.start();
console.warn(`⚠️ Audio key not found: ${key} - Skipping to prevent crash.`);
}
} catch (error) {
console.error('❌ Audio error (non-critical):', error.message);
console.log('✅ Game continues without music');
console.error('❌ Audio error (handled):', error.message);
}
}
createMainMenu(width, height) {
// Get localized button texts
// Ensure i18n is initialized
if (!window.i18n) window.i18n = new LocalizationSystem();
const i18n = window.i18n;
// Use keys from localization.json (menu.new_game etc.)
const buttons = [
{
label: i18n ? i18n.t('new_game', '▶ NEW GAME') : '▶ NEW GAME',
label: i18n.t('new_game', '▶ NEW GAME'),
color: '#8fbc8f',
action: () => this.startNewGame()
},
{
label: i18n ? i18n.t('load_game', '📁 LOAD GAME') : '📁 LOAD GAME',
label: i18n.t('load_game', '📁 LOAD GAME'),
color: '#87ceeb',
action: () => this.loadGame()
},
{
label: i18n ? i18n.t('settings', '⚙️ SETTINGS') : '⚙️ SETTINGS',
label: i18n.t('settings', '⚙️ SETTINGS'),
color: '#daa520',
action: () => this.showSettings()
},
{
label: i18n ? i18n.t('exit', '❌ EXIT') : '❌ EXIT',
label: i18n.t('exit', '❌ EXIT'),
color: '#cd5c5c',
action: () => this.exitGame()
}
@@ -449,8 +451,8 @@ class StoryScene extends Phaser.Scene {
startNewGame() {
console.log('🎮 Starting New Game...');
console.log('🎥 Launching ULTIMATE Prologue (100% Polished!)...');
this.scene.start('UltimatePrologueScene'); // ✅ ULTIMATE INTRO!
console.log('🎥 Launching Amnesia Start Sequence...');
this.scene.start('IntroScene'); // ✅ AMNESIA START
}
loadGame() {