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:
@@ -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