diff --git a/nova farma TRAE/assets/.DS_Store b/nova farma TRAE/assets/.DS_Store index 524e397eb..367e68d65 100644 Binary files a/nova farma TRAE/assets/.DS_Store and b/nova farma TRAE/assets/.DS_Store differ diff --git a/nova farma TRAE/assets/DEMO_FAZA1/.DS_Store b/nova farma TRAE/assets/DEMO_FAZA1/.DS_Store index 822c70eaf..8753f3021 100644 Binary files a/nova farma TRAE/assets/DEMO_FAZA1/.DS_Store and b/nova farma TRAE/assets/DEMO_FAZA1/.DS_Store differ diff --git a/nova farma TRAE/src/scenes/GrassScene_Clean.js b/nova farma TRAE/src/scenes/GrassScene_Clean.js index 1b98066dd..946a2029a 100644 --- a/nova farma TRAE/src/scenes/GrassScene_Clean.js +++ b/nova farma TRAE/src/scenes/GrassScene_Clean.js @@ -158,10 +158,48 @@ export default class GrassSceneClean extends Phaser.Scene { this.hole.setDepth(-48); // On ground, below pond/items this.physics.add.existing(this.hole, true); // Static body for trigger + // --- REALISTIC TREE DEMO --- + // Lokacija: Malo levo od igralca + const treeX = WORLD_W / 2 - 300; + const treeY = WORLD_H / 2; + + // 1. Senca (Shadow) - Rahla temna elipsa za globino + const shadow = this.add.ellipse(treeX, treeY + 10, 140, 60, 0x000000); + shadow.setAlpha(0.3); + shadow.setDepth(treeY - 1); // Malo pod drevesom + + // 2. Drevo (Tree) - Z 'clipping' efektom + const tree = this.add.image(treeX, treeY, 'tree_adult_0'); + // Nastavimo origin na (0.5, 0.9) namesto (0.5, 1.0). + // To pomeni, da bo spodnjih 10% slike "pod" točko (x,y). + // S tem ustvarimo efekt, da deblo "potone" v tla. + tree.setOrigin(0.5, 0.9); + tree.setDepth(treeY); // Y-sort na točki stika + this.physics.add.existing(tree, true); // Collider + // Manjši collider za deblo + tree.body.setSize(60, 40); + tree.body.setOffset(tree.width/2 - 30, tree.height * 0.9 - 20); + + // 3. Trava okoli debla (Grass Masking / Feathering) + // Postavimo par šopov trave točno na stik debla in tal, da skrijemo rob. + for(let i=0; i<8; i++) { + let angle = Math.random() * Math.PI * 2; + let dist = Math.random() * 30; // Blizu debla + let gx = treeX + Math.cos(angle) * dist; + let gy = treeY + Math.sin(angle) * 10; // Sploščeno po Y osi (izometrično) + + let grassKey = Math.random() > 0.5 ? 'grass_wild' : 'grass_wild_v2'; + let grass = this.add.image(gx, gy, grassKey); + + grass.setScale(0.3 + Math.random() * 0.3); // Manjši šopi + grass.setDepth(treeY + 2); // Malo NAD drevesom, da prekrijejo spodnji rob debla! + grass.setOrigin(0.5, 1.0); + grass.setTint(0xcccccc); // Rahlo temnejša trava (v senci drevesa) + grass.setAlpha(0.9); + } + /* // Center the whole construction - const startX = WORLD_W / 2; - const startY = WORLD_H / 2 - 300; // Start higher up to leave room for extensions // Main Head (Pipe + Splash) // Showing V7 Asset (Aggressive Clean + Transparent Green)