This commit is contained in:
2025-12-08 01:00:56 +01:00
parent 7834aee111
commit 9c61c3b56d
20 changed files with 675 additions and 129 deletions

View File

@@ -0,0 +1,56 @@
/**
* 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);