popravek zombijo

This commit is contained in:
2025-12-07 13:16:04 +01:00
parent 2404d44ef7
commit 98059a2659
9 changed files with 577 additions and 385 deletions

View File

@@ -448,8 +448,21 @@ class UIScene extends Phaser.Scene {
}
update() {
// Here we could update bars based on player stats
// if (this.gameScene && this.gameScene.player) { ... }
if (!this.gameScene) return;
// Sync HP Bar
if (this.gameScene.player && this.healthBar) {
const hp = this.gameScene.player.hp !== undefined ? this.gameScene.player.hp : 100;
const maxHp = this.gameScene.player.maxHp || 100;
this.setBarValue(this.healthBar, (hp / maxHp) * 100);
}
// Sync Hunger/Thirst (if stats system exists)
if (this.gameScene.statsSystem && this.hungerBar && this.thirstBar) {
const stats = this.gameScene.statsSystem;
this.setBarValue(this.hungerBar, stats.hunger);
this.setBarValue(this.thirstBar, stats.thirst);
}
}
toggleBuildMenu(isVisible) {
if (!this.buildMenuContainer) {