kockasta mapa

This commit is contained in:
2025-12-07 14:28:39 +01:00
parent 98059a2659
commit 045bf24792
11 changed files with 670 additions and 1249 deletions

View File

@@ -19,7 +19,7 @@ class UIScene extends Phaser.Scene {
this.createInventoryBar();
this.createGoldDisplay();
this.createClock();
this.createDebugInfo();
// this.createDebugInfo();
this.createSettingsButton();
// Resize event
@@ -430,21 +430,25 @@ class UIScene extends Phaser.Scene {
createDebugInfo() {
if (this.debugText) this.debugText.destroy();
if (this.debugBg) this.debugBg.destroy();
// Use scale height to position at bottom left (above inventory?) or top left
// Original was 10, 100 (top leftish). User said "manjkajo na dnu".
// Let's put it top left but ensure it is recreated.
// Actually, user said stats missing on top/bottom.
// Debug info is usually extra.
// Let's stick to simple recreation.
const x = this.scale.width - 170;
const y = 120; // Below Gold and Clock area
this.debugText = this.add.text(10, 100, '', {
// Background
this.debugBg = this.add.graphics();
this.debugBg.fillStyle(0x000000, 0.7);
this.debugBg.fillRect(x, y, 160, 70);
this.debugBg.setDepth(2999);
this.debugText = this.add.text(x + 10, y + 10, 'Waiting for stats...', {
fontSize: '12px',
fontFamily: 'monospace',
fill: '#00ff00', // Green as requested before? Or White? Sticking to Green from file.
fill: '#ffffff',
stroke: '#000000',
strokeThickness: 3
strokeThickness: 2
});
this.debugText.setDepth(3000);
}
update() {
@@ -457,7 +461,6 @@ class UIScene extends Phaser.Scene {
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);