popravek zombijo
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user