/** * ANTIGRAVITY ENGINE * Core system for NovaFarma */ window.Antigravity = { Config: { Tileset: { Spacing: 0, Margin: 0, TextureFilter: 'NEAREST' } }, Rendering: { /** * Zagotavlja pravilno globinsko razvrščanje (Depth Sorting) vseh spritov * @param {Phaser.Scene} scene */ depthSortSprites: function (scene) { // 1. Player Depth if (scene.player && scene.player.sprite) { scene.player.updateDepth(); } // 2. NPC Depth if (scene.npcs) { scene.npcs.forEach(npc => { if (npc && npc.sprite && npc.sprite.visible) { npc.updateDepth(); // Vsak NPC ima svojo metodo } }); } // 3. Projectiles / Particles (če bi jih imeli ločene) // ... } }, Physics: { checkCollisions: function (scene) { // Placeholder za centraliziran collision logic } }, /** * Glavni update loop za Engine * @param {Phaser.Scene} scene * @param {number} delta */ Update: function (scene, delta) { this.Rendering.depthSortSprites(scene); } }; console.log('🌌 Antigravity Engine Initialized', window.Antigravity.Config);