WIP: Camera controls, WebGL setup, Procedural grass attempt (Black screen debug)

This commit is contained in:
2026-01-18 05:35:23 +01:00
parent 91eb68a65f
commit de089e5b01
16 changed files with 353 additions and 2912 deletions

View File

@@ -38,7 +38,7 @@ class BootScene extends Phaser.Scene {
create() {
console.log('✅ BootScene: Complete!');
console.log('🎨 Pixel Art Mode: pixelArt=true, roundPixels=true (NEAREST filtering)');
console.log('🎨 SMOOTH Rendering Mode: pixelArt=FALSE, roundPixels=FALSE (LINEAR filtering - filmski look)');
window.gameState.currentScene = 'BootScene';
// Global Constants for Sprites

File diff suppressed because it is too large Load Diff

View File

@@ -34,18 +34,16 @@ class IntroScene extends Phaser.Scene {
this.load.image('intro_ana_barbershop', dreamyPath + 'ana_barbershop_dreads_dreamy.png');
this.load.image('intro_birthday_cake', dreamyPath + 'birthday_cake_rd_dreamy.png');
this.load.image('intro_virus', introPath + 'virus_xnoir_microscope.png');
this.load.image('intro_chaos', dreamyPath + 'chaos_streets_apocalypse_dreamy.png');
this.load.image('intro_zombies', dreamyPath + 'zombie_silhouettes_panic_dreamy.png');
this.load.image('intro_parents_ghosts', dreamyPath + 'parents_transparent_ghosts_dreamy.png');
this.load.image('intro_ana_taken', introPath + 'ana_taken_military.png');
this.load.image('intro_kai_alone', introPath + 'kai_alone_basement.png');
this.load.image('intro_kai_young', introPath + 'kai_young_timelapse.png');
this.load.image('intro_kai_adult', introPath + 'kai_adult_35_timelapse.png');
this.load.image('intro_kai_elder', introPath + 'kai_elder_50_timelapse.png');
this.load.image('intro_ana_memory', introPath + 'ana_memory_flash_purple.png');
this.load.image('intro_bedroom', introPath + 'kai_bedroom_wakeup.png');
this.load.image('intro_gronk', introPath + 'gronk_doorway_silhouette.png');
this.load.image('intro_twins_childhood', introPath + 'kai_ana_twins_childhood.png');
// REMOVED STORY ASSETS TO PREVENT 404
// this.load.image('intro_kai_alone', introPath + 'kai_alone_basement.png');
// Missing assets commented out to clean console errors
// this.load.image('intro_ana_memory', introPath + 'ana_memory_flash_purple.png');
// this.load.image('intro_bedroom', introPath + 'kai_bedroom_wakeup.png'); // This was not in the instruction, but it's likely a missing asset too.
// this.load.image('intro_gronk_doorway', introPath + 'gronk_doorway_silhouette.png');
// this.load.image('intro_kai_twins', introPath + 'kai_ana_twins_childhood.png');
// this.load.image('intro_kai_basement', introPath + 'kai_alone_basement.png'); // This seems to be a duplicate of intro_kai_alone, but with a different key.
console.log('✅ IntroScene assets skipped (clean console check)');
// 🎵 AMBIENT MUSIC
this.loadAudioSafe('noir_ambience', 'assets/audio/ambient/noir_ambience.mp3');

View File

@@ -57,76 +57,29 @@ class PreloadScene extends Phaser.Scene {
// Load Manifest Images
// Since we are using script tags in index.html, window.AssetManifest is already available!
if (window.AssetManifest) {
const manifest = window.AssetManifest;
// REMOVED MANIFEST CHECK - FORCE LOAD ASSETS
console.log('📦 FORCE LOADING ASSETS (No Manifest Check)...');
console.log(`📦 Loading Asset Manifest (Phased)...`);
// 🎨 TILESET IMAGES
console.log('🔍 LOADING REFERENCE GRASS: assets/slike/teren/grass_tile.png');
this.load.image('trava_osnova', 'assets/slike/teren/grass_tile.png');
this.load.image('tileset_grass', 'assets/slike/teren/grass_tile.png'); // Duplicate for safety
// Iterate over phases (farm, basement_mine, etc.)
if (manifest.phases) {
Object.keys(manifest.phases).forEach(phaseName => {
console.log(`Phase: ${phaseName} - ${manifest.phases[phaseName].length} items`);
manifest.phases[phaseName].forEach(img => {
this.loadImageSafe(img.key, img.path);
});
});
}
this.load.image('tileset_dirt', 'assets/slike/teren/dirt.png');
this.load.image('tileset_water', 'assets/slike/teren/water.png');
this.load.image('tileset_stone', 'assets/slike/teren/stone.png');
// Iterate over spritesheets
if (manifest.spritesheets) {
manifest.spritesheets.forEach(sheet => {
this.load.spritesheet(sheet.key, sheet.path, sheet.frameConfig);
});
}
// Legacy Keys
this.load.image('tileset_Terrain_Grass', 'assets/slike/teren/grass_tile.png');
this.load.image('tileset_Terrain_Dirt', 'assets/slike/teren/dirt.png');
this.load.image('tileset_Terrain_Water', 'assets/slike/teren/water.png');
console.log('✅ AssetManifest Queue Complete');
console.log('✅ All Tilesets Preloaded!');
// 🗺️ TILESET IMAGES (For Tiled maps - Faza1_Finalna.tmx)
console.log('🎨 Preloading All Tileset Images...');
// Terrain - UPDATED FOR STYLE 32 (Flat2DTerrainSystem keys)
console.log('🔍 ATTEMPTING LOAD: assets/slike/teren/grass_tile.png');
this.load.image('trava_osnova', 'assets/slike/teren/grass_tile.png');
// Legacy/Map keys
this.load.image('tileset_grass', 'assets/slike/teren/grass_tile.png'); // Keep for map compatibility
// Intro Assets (Verified paths in assets/slike/zgodba)
// 'ana_memory_flash' not found, using 'intro_twin_photo' as placeholder
this.load.image('intro_ana_memory', 'assets/slike/zgodba/assets_references_intro_twin_photo.png');
// 'kai_bedroom_wakeup' not found, using 'intro_cellar' placeholder for now
this.load.image('intro_bedroom_wakeup', 'assets/slike/zgodba/assets_references_intro_cellar_ruins.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'); // DISABLED: Not found in teren
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/slike/teren/grass_tile.png');
this.load.image('tileset_Terrain_Dirt', 'assets/slike/teren/dirt.png');
this.load.image('tileset_Terrain_Water', 'assets/slike/teren/water.png');
// Fences (Commented out if not in teren/okolje yet, likely in ZA_PREGLED)
// this.load.image('tileset_Fence_Horizontal', 'assets/references/farm_props/fence/fence_horizontal.png');
// this.load.image('tileset_Fence_Vertical', 'assets/references/farm_props/fence/fence_vertical.png');
// this.load.image('tileset_Fence_Corner', 'assets/references/farm_props/fence/fence_corner.png');
// Trees (Commented out legacy paths)
// this.load.image('tileset_Tree_Apple', 'assets/references/trees/apple/apple_tree.png');
// this.load.image('tileset_Tree_Cherry', 'assets/references/trees/cherry/cherry_tree.png');
// this.load.image('tileset_Tree_Dead', 'assets/maps/tilesets/Tree_Dead.png');
// Buildings
// this.load.image('tileset_House_Gothic', 'assets/references/buildings/kai_house/04_gothic_house.png');
console.log('✅ All Tilesets Preloaded!');
// MAP (Tiled JSON)
this.load.tilemapTiledJSON('NovaFarma', 'assets/maps/NovaFarma.json');
console.log('🗺️ Preloading NovaFarma.json map...');
} else {
console.error('❌ Critical: window.AssetManifest not found! Check index.html imports.');
}
// MAP (Tiled JSON)
// Found at: assets/maps/NovaFarma.json
this.load.tilemapTiledJSON('NovaFarma', 'assets/maps/NovaFarma.json');
console.log('🗺️ Preloading NovaFarma.json map...');
}
loadImageSafe(key, path) {
@@ -145,7 +98,7 @@ class PreloadScene extends Phaser.Scene {
// this.load.audio('background_music', 'assets/audio/bg_noir.mp3');
// 🧛‍♂️ GRONK SPRITESHEET (Verified)
// 🧛‍♂️ GRONK (Verified Path: assets/slike/liki/gronk_pro_sheet.png)
this.load.spritesheet('gronk_pro_sheet', 'assets/slike/liki/gronk_pro_sheet.png', {
frameWidth: 128,
frameHeight: 128
@@ -597,8 +550,8 @@ class PreloadScene extends Phaser.Scene {
// ✅ Starting INTRO SEQUENCE (NEW! Jan 10, 2026)
this.time.delayedCall(500, () => {
console.log('🎬 Starting IntroScene (Cinematic Intro)...');
this.scene.start('IntroScene'); // ← NEW INTRO SEQUENCE
console.log('🎬 Starting GameScene (DEMO MODE - SKIP INTRO)...');
this.scene.start('GameScene'); // ← NEW INTRO SEQUENCE
});
}
});
@@ -607,15 +560,15 @@ 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);
}
// 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.

View File

@@ -2240,7 +2240,7 @@ class UIScene extends Phaser.Scene {
// Background - FARM THEME
const bg = this.add.graphics();
bg.fillStyle(0x4a3520, 0.9); // Brown wood
bg.fillStyle(0x4a3520, 0.7); // Brown wood (70% alpha for noir)
bg.fillRect(0, 0, panelWidth, panelHeight);
bg.lineStyle(3, 0x8B4513, 0.8); // Saddle brown
bg.strokeRect(0, 0, panelWidth, panelHeight);
@@ -2298,7 +2298,7 @@ class UIScene extends Phaser.Scene {
// Background - FARM THEME
const bg = this.add.graphics();
bg.fillStyle(0x2a4a2a, 0.9); // Dark green
bg.fillStyle(0x2a4a2a, 0.7); // Dark green (70% alpha for noir)
bg.fillRect(0, 0, panelWidth, panelHeight);
bg.lineStyle(3, 0x90EE90, 0.8); // Light green border
bg.strokeRect(0, 0, panelWidth, panelHeight);