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

@@ -17,6 +17,9 @@ class GameScene extends Phaser.Scene {
create() {
console.log('🎮 GameScene: Initialized!');
// Generate procedural textures
new TextureGenerator(this).generateAll();
window.gameState.currentScene = 'GameScene';
const width = this.cameras.main.width;
@@ -28,6 +31,9 @@ class GameScene extends Phaser.Scene {
// Initialize Isometric Utils
this.iso = new IsometricUtils();
// Initialize Spatial Grid
this.spatialGrid = new SpatialGrid(10);
// Inicializiraj terrain sistem - 100x100 mapa
console.log('🌍 Initializing terrain...');
try {
@@ -101,6 +107,7 @@ class GameScene extends Phaser.Scene {
this.statsSystem = new StatsSystem(this);
this.inventorySystem = new InventorySystem(this);
this.lootSystem = new LootSystem(this);
this.interactionSystem = new InteractionSystem(this);
this.farmingSystem = new FarmingSystem(this);
this.buildingSystem = new BuildingSystem(this);
@@ -205,6 +212,7 @@ class GameScene extends Phaser.Scene {
// Update Systems
// TimeSystem update removed (handled by WeatherSystem)
if (this.statsSystem) this.statsSystem.update(delta);
if (this.lootSystem) this.lootSystem.update(delta); // Loot System Update
if (this.interactionSystem) this.interactionSystem.update(delta);
if (this.farmingSystem) this.farmingSystem.update(delta);
// DayNight update removed (handled by WeatherSystem)

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);