Phase 29: COMPLETE - Key bindings + update loop integration

This commit is contained in:
2025-12-17 20:09:19 +01:00
parent 457d615cc2
commit b058a8cb75

View File

@@ -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() {