From b058a8cb75aa2e88dcf908f1f15ac1aa93e877d1 Mon Sep 17 00:00:00 2001 From: NovaFarma Dev Date: Wed, 17 Dec 2025 20:09:19 +0100 Subject: [PATCH] Phase 29: COMPLETE - Key bindings + update loop integration --- src/scenes/GameScene.js | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/scenes/GameScene.js b/src/scenes/GameScene.js index d8eba15..b6543e2 100644 --- a/src/scenes/GameScene.js +++ b/src/scenes/GameScene.js @@ -813,6 +813,32 @@ class GameScene extends Phaser.Scene { console.log('✅ GameScene ready - FAZA 20 (Full Features)!'); + // 🎮 PHASE 29: KEY BINDINGS + console.log('🎮 Setting up Phase 29 key bindings...'); + + // E key - Interact with structures/chests + this.input.keyboard.on('keydown-E', () => { + if (this.structureInteraction) { + this.structureInteraction.interact(); + } + }); + + // T key - Talk to NPCs + this.input.keyboard.on('keydown-T', () => { + if (this.npcPopulation) { + this.npcPopulation.talkToNPC(); + } + }); + + // M key - Toggle full map + this.input.keyboard.on('keydown-M', () => { + if (this.mapReveal) { + this.mapReveal.toggleFullMap(); + } + }); + + console.log('✅ Phase 29 key bindings ready! (E: Interact, T: Talk, M: Map)'); + // Global command: giveSeeds(amount) - daj seeds najbližjemu tamed zombiju window.giveSeeds = (amount = 10) => { if (!this.zombieWorkerSystem || !this.player) { @@ -2043,6 +2069,35 @@ class GameScene extends Phaser.Scene { } else { console.warn('⚠️ TerrainSystem.update not available!'); } + + // 🎮 PHASE 29: SYSTEM UPDATES + const playerGridX = this.player ? this.player.gridX : 250; + const playerGridY = this.player ? this.player.gridY : 250; + + // Structure Interaction (check for nearby chests) + if (this.structureInteraction) { + this.structureInteraction.update(playerGridX, playerGridY); + } + + // NPC Population (check for nearby NPCs) + if (this.npcPopulation) { + this.npcPopulation.update(playerGridX, playerGridY); + } + + // Biome Enemies (AI movement, combat) + if (this.biomeEnemies) { + this.biomeEnemies.update(Date.now(), delta, playerGridX, playerGridY); + } + + // Map Reveal (fog of war) + if (this.mapReveal) { + this.mapReveal.update(); + + // Create minimap on first update + if (!this.mapReveal.minimap && this.player) { + this.mapReveal.createMinimap(); + } + } } createParallaxBackground() {