farma updejt

This commit is contained in:
2025-12-08 01:39:39 +01:00
parent 9c61c3b56d
commit e49f567831
12 changed files with 596 additions and 99 deletions

View File

@@ -279,10 +279,10 @@ class TerrainSystem {
};
// Place Trees dynamically during generation
this.placeTree(x, y, terrainType.name);
// this.placeTree(x, y, terrainType.name);
// Place Rocks dynamically
this.placeRock(x, y, terrainType.name);
// this.placeRock(x, y, terrainType.name);
}
}
@@ -699,7 +699,18 @@ class TerrainSystem {
const sprite = this.cropPool.get();
const screenPos = this.iso.toScreen(x, y);
sprite.setPosition(Math.round(screenPos.x + this.offsetX), Math.round(screenPos.y + this.offsetY - voxelOffset));
sprite.setTexture(`crop_stage_${crop.stage}`);
const cropType = crop.type || 'wheat';
// Če je wheat, uporabimo 'crop_stage_' za nazaj združljivost s TextureGeneratorjem?
// TextureGenerator dela 'crop_stage_X'.
// Če dodam 'wheat_stage_X', moram posodobiti TextureGenerator.
// Za zdaj:
let textureKey = `crop_stage_${crop.stage}`;
if (cropType === 'corn') textureKey = `corn_stage_${crop.stage}`;
if (cropType === 'wheat' && this.scene.textures.exists('wheat_stage_1')) textureKey = `wheat_stage_${crop.stage}`;
sprite.setTexture(textureKey);
sprite.setOrigin(0.5, 1);
// Layer Objects (da igralec hodi okoli njih)
sprite.setDepth(this.iso.getDepth(x, y, this.iso.LAYER_OBJECTS));