FINALNI BATCH - Vse spremembe shranjene
Zadnji batch danes vključuje: 1. TASKS.md - Phase 28 update 2. GameScene.js - Biome init popravki 3. Flat2DTerrainSystem.js - Debug logi + zaščite 4. DNEVNI_REPORT_2025-12-15.md - Complete daily summary 5. PHASE28_SESSIONS_4_5_6_PLAN.md - Future sessions plan Status: - Part 3: 100% - Phase 28 Sessions 1-3: 100% - Sessions 4-6: Načrtovano Vse commitano in pripravljeno!
This commit is contained in:
@@ -74,8 +74,20 @@ class GameScene extends Phaser.Scene {
|
||||
console.log('🎨 Initializing Flat 2D Terrain...');
|
||||
this.terrainSystem = new Flat2DTerrainSystem(this);
|
||||
|
||||
// 🌍 PHASE 28: Connect biome systems (will be created in constructor)
|
||||
// This allows terrainSystem to use biomes when they're available
|
||||
// 🌍 PHASE 28: Initialize BiomeSystem and ChunkManager BEFORE terrain generation!
|
||||
console.log('🌍 Initializing Biome System (500x500 world)...');
|
||||
this.biomeSystem = new BiomeSystem(this);
|
||||
this.biomeSystem.generateBiomeMap(); // Generate biome layout
|
||||
console.log('✅ Biome map generated!');
|
||||
|
||||
console.log('💾 Initializing Chunk Manager...');
|
||||
this.chunkManager = new ChunkManager(this, 50); // 50x50 chunks
|
||||
console.log('✅ Chunk Manager ready!');
|
||||
|
||||
// Connect systems to terrainSystem
|
||||
this.terrainSystem.biomeSystem = this.biomeSystem;
|
||||
this.terrainSystem.chunkManager = this.chunkManager;
|
||||
console.log('✅ BiomeSystem & ChunkManager connected to terrainSystem');
|
||||
|
||||
await this.terrainSystem.generate();
|
||||
console.log('✅ Flat 2D terrain ready!');
|
||||
@@ -522,21 +534,8 @@ class GameScene extends Phaser.Scene {
|
||||
console.log('🌬️ Initializing Weather Enhancements System...');
|
||||
this.weatherEnhancements = new WeatherEnhancementsSystem(this);
|
||||
|
||||
// 🌍 PHASE 28: BIOME SYSTEM
|
||||
console.log('🌍 Initializing Biome System (500x500 world)...');
|
||||
this.biomeSystem = new BiomeSystem(this);
|
||||
this.biomeSystem.generateBiomeMap(); // Generate biome layout
|
||||
|
||||
// 💾 PHASE 28: CHUNK MANAGER
|
||||
console.log('💾 Initializing Chunk Manager...');
|
||||
this.chunkManager = new ChunkManager(this, 50); // 50x50 chunks
|
||||
|
||||
// 🌍 PHASE 28: Connect systems to terrainSystem
|
||||
if (this.terrainSystem) {
|
||||
this.terrainSystem.biomeSystem = this.biomeSystem;
|
||||
this.terrainSystem.chunkManager = this.chunkManager;
|
||||
console.log('✅ BiomeSystem & ChunkManager connected to terrainSystem');
|
||||
}
|
||||
// 🌍 PHASE 28: BiomeSystem & ChunkManager already initialized in create() before terrain generation!
|
||||
// No need to initialize again here.
|
||||
|
||||
// 🎨 UI POLISH SYSTEM
|
||||
console.log('🎨 UI POLISH System...');
|
||||
|
||||
@@ -25,6 +25,7 @@ class Flat2DTerrainSystem {
|
||||
// 🌍 PHASE 28: Biome support
|
||||
this.biomeSystem = null; // Will be set by GameScene
|
||||
this.chunkManager = null; // Will be set by GameScene
|
||||
this.chunkSize = 50; // Chunk size for rendering (matches ChunkManager)
|
||||
|
||||
console.log('🎨 Flat2DTerrainSystem initialized (500x500 world)');
|
||||
}
|
||||
@@ -277,6 +278,12 @@ class Flat2DTerrainSystem {
|
||||
}
|
||||
|
||||
renderMap() {
|
||||
// 🌍 PHASE 28: Skip if using biome system!
|
||||
if (this.biomeSystem && this.chunkManager) {
|
||||
console.log('⏭️ Skipping renderMap() - using BiomeSystem chunk rendering instead');
|
||||
return;
|
||||
}
|
||||
|
||||
// 🎨 SIMPLE & CLEAN: Use TileSprite for seamless background!
|
||||
const size = this.tileSize;
|
||||
const mapWidth = this.width * size;
|
||||
@@ -354,7 +361,11 @@ class Flat2DTerrainSystem {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`🎨 renderChunk START: (${chunk.chunkX}, ${chunk.chunkY})`);
|
||||
|
||||
const size = this.tileSize;
|
||||
let tilesRendered = 0;
|
||||
const biomeCounts = {};
|
||||
|
||||
// Render ground tiles based on biome
|
||||
for (const tileData of chunk.tiles) {
|
||||
@@ -362,6 +373,9 @@ class Flat2DTerrainSystem {
|
||||
const worldX = x * size;
|
||||
const worldY = y * size;
|
||||
|
||||
// Count biomes
|
||||
biomeCounts[biome] = (biomeCounts[biome] || 0) + 1;
|
||||
|
||||
// Get biome-specific tile texture
|
||||
let tileTexture = 'tile2d_grass'; // Default
|
||||
|
||||
@@ -385,6 +399,8 @@ class Flat2DTerrainSystem {
|
||||
if (!chunk.sprites) chunk.sprites = [];
|
||||
chunk.sprites.push(tileSprite);
|
||||
|
||||
tilesRendered++;
|
||||
|
||||
// Apply biome features (trees, rocks, etc.)
|
||||
if (this.biomeSystem) {
|
||||
const features = this.biomeSystem.applyBiomeFeatures(x, y);
|
||||
@@ -395,6 +411,9 @@ class Flat2DTerrainSystem {
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`✅ renderChunk END: ${tilesRendered} tiles rendered`);
|
||||
console.log(`📊 Biomes in chunk:`, biomeCounts);
|
||||
|
||||
console.log(`✅ Chunk (${chunk.chunkX}, ${chunk.chunkY}) rendered with biomes`);
|
||||
|
||||
// 🐛 DEBUG: Add visible border around chunk
|
||||
|
||||
Reference in New Issue
Block a user