dreva in kamni top

This commit is contained in:
2025-12-07 22:32:45 +01:00
parent 974141c08c
commit 6b8f9aee66
13 changed files with 384 additions and 90 deletions

View File

@@ -311,6 +311,26 @@ class TextureGenerator {
});
}
static createSaplingSprite(scene, key = 'tree_sapling') {
if (scene.textures.exists(key)) return;
const size = 32;
const canvas = scene.textures.createCanvas(key, size, size);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, size, size);
// Majhno steblo
ctx.fillStyle = '#8B4513';
ctx.fillRect(14, 20, 4, 12);
// Parnosti listov
ctx.fillStyle = '#32CD32';
ctx.beginPath(); ctx.arc(12, 18, 4, 0, Math.PI * 2); ctx.fill();
ctx.beginPath(); ctx.arc(20, 18, 4, 0, Math.PI * 2); ctx.fill();
ctx.beginPath(); ctx.arc(16, 12, 5, 0, Math.PI * 2); ctx.fill();
canvas.refresh();
}
// Helper to generate ALL textures at once
generateAll() {
TextureGenerator.createPlayerSprite(this.scene);
@@ -319,6 +339,7 @@ class TextureGenerator {
TextureGenerator.createFlowerSprite(this.scene);
TextureGenerator.createBushSprite(this.scene);
TextureGenerator.createSaplingSprite(this.scene, 'tree_sapling'); // Dodano
TextureGenerator.createTreeSprite(this.scene); // Volumetric
TextureGenerator.createRockSprite(this.scene); // Volumetric
TextureGenerator.createCloudSprite(this.scene);