Fixed Critical Assets & Map: Embedded Tilesets in JSON, Created Texture Atlases, Fixed Pathing for Intro/Terrain, Added Audio
This commit is contained in:
@@ -22,11 +22,11 @@ class IntroScene extends Phaser.Scene {
|
||||
console.log('🎬 IntroScene: Loading EPIC 60s assets...');
|
||||
|
||||
// Base path for intro shots
|
||||
const introPath = 'assets/references/intro_shots/';
|
||||
const introPath = 'assets/slike/intro_assets/';
|
||||
|
||||
// ALL 20 INTRO SHOTS
|
||||
// DREAMY INTRO ASSETS (Generated)
|
||||
const dreamyPath = 'assets/images/intro_sequence/';
|
||||
const dreamyPath = 'assets/slike/intro_assets/';
|
||||
|
||||
this.load.image('intro_family_portrait', dreamyPath + 'family_portrait_complete_dreamy.png');
|
||||
this.load.image('intro_otac_longboard', dreamyPath + 'otac_longboard_pier_dreamy.png');
|
||||
|
||||
@@ -85,16 +85,17 @@ class PreloadScene extends Phaser.Scene {
|
||||
console.log('🎨 Preloading All Tileset Images...');
|
||||
|
||||
// Terrain - UPDATED FOR STYLE 32 (Flat2DTerrainSystem keys)
|
||||
this.load.image('tileset_grass', 'assets/grounds/grass.png');
|
||||
this.load.image('tileset_dirt', 'assets/grounds/dirt.png');
|
||||
this.load.image('tileset_water', 'assets/grounds/water.png');
|
||||
this.load.image('tileset_farmland', 'assets/grounds/farmland.png'); // Added Farmland
|
||||
this.load.image('tileset_stone', 'assets/grounds/stone.png');
|
||||
console.log('🔍 ATTEMPTING LOAD: assets/slike/teren/grass.png');
|
||||
this.load.image('tileset_grass', 'assets/slike/teren/grass.png');
|
||||
this.load.image('tileset_dirt', 'assets/slike/teren/dirt.png');
|
||||
this.load.image('tileset_water', 'assets/slike/teren/water.png');
|
||||
this.load.image('tileset_farmland', 'assets/slike/teren/farmland.png'); // Added Farmland
|
||||
this.load.image('tileset_stone', 'assets/slike/teren/stone.png');
|
||||
|
||||
// Legacy Keys (Keep for Tiled Map compatibility if needed)
|
||||
this.load.image('tileset_Terrain_Grass', 'assets/grounds/grass.png');
|
||||
this.load.image('tileset_Terrain_Dirt', 'assets/grounds/dirt.png');
|
||||
this.load.image('tileset_Terrain_Water', 'assets/grounds/water.png');
|
||||
this.load.image('tileset_Terrain_Grass', 'assets/slike/teren/grass.png');
|
||||
this.load.image('tileset_Terrain_Dirt', 'assets/slike/teren/dirt.png');
|
||||
this.load.image('tileset_Terrain_Water', 'assets/slike/teren/water.png');
|
||||
|
||||
// Fences
|
||||
this.load.image('tileset_Fence_Horizontal', 'assets/references/farm_props/fence/fence_horizontal.png');
|
||||
@@ -154,6 +155,7 @@ class PreloadScene extends Phaser.Scene {
|
||||
this.loadAudioSafe('kai_voice_5', basePath + 'kai/kai_05.mp3');
|
||||
|
||||
// 🎵 AMBIENT
|
||||
this.load.audio('background_music', 'assets/audio/bg_noir.mp3');
|
||||
// this.loadAudioSafe('forest_ambient', 'assets/audio/music/forest_ambient.mp3'); // DISABLED: Causing reload loop
|
||||
|
||||
|
||||
@@ -625,6 +627,17 @@ class PreloadScene extends Phaser.Scene {
|
||||
}
|
||||
|
||||
create() {
|
||||
console.log('🎵 Starting Background Music Loop...');
|
||||
try {
|
||||
if (!this.sound.get('background_music')) {
|
||||
this.sound.play('background_music', { loop: true, volume: 0.5 });
|
||||
} else if (!this.sound.get('background_music').isPlaying) {
|
||||
this.sound.get('background_music').play();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('🎵 Audio Playback Failed (Autoplay policy?):', e);
|
||||
}
|
||||
|
||||
// The actual scene start logic has been moved to the 'load.on(complete)' callback
|
||||
// to ensure all assets are fully loaded and the loading bar has faded out.
|
||||
// This 'create' method now primarily serves as a placeholder or for any
|
||||
|
||||
@@ -730,7 +730,7 @@ class Flat2DTerrainSystem {
|
||||
// Ensure tiling works correctly (no stretching)
|
||||
// Ensure tiling works correctly (no stretching)
|
||||
if (grassKey === 'tileset_grass') {
|
||||
grassBG.setTileScale(1, 1); // 1:1 scale (256px repeating)
|
||||
grassBG.setTileScale(0.25, 0.25); // 512px -> 128px visuals (Sharper Noir)
|
||||
} else {
|
||||
grassBG.setTint(0x00FF00); // Bright Green if fallback!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user