🎮 WEEK 1 DEBUG COMMANDS COMPLETE!
✅ 11 KEYBOARD SHORTCUTS ADDED: 🔧 SPAWN NPCS: - F10: Spawn Electrician (near player) - F11: Spawn Zombie Statistician (near player) 🏗️ BUILD STRUCTURES: - F12: Build ALL Week 1 buildings (Generator, City Hall, Board, Depot) 📦 RESOURCE TESTING: - Numpad 1: Add resources (100 wood, 50 food, 75 stone) - Numpad 2: Drop resources around player (for auto-pickup test) 💼 EMPLOYMENT: - Numpad 3: Hire Electrician (auto-hire) - Numpad 4: Hire Zombie Statistician (auto-hire) 🎬 TRIGGER ACTIONS: - Numpad 5: Electrician inspection (walk to generator, inspect) - Numpad 6: Electrician repair (walk, repair with VFX!) - Numpad 7: Zombie Statistician update board (walk, update stats) 📊 DEBUG INFO: - Numpad 8: Show all Week 1 stats (resources, population, generator) 🎯 TESTING WORKFLOW: 1. Press F12 (build all structures) 2. Press F10 + F11 (spawn both NPCs) 3. Press Numpad 3 + 4 (hire both) 4. Press Numpad 2 (drop test resources) 5. Press Numpad 6 (watch Electrician repair with sparks!) 6. Press Numpad 7 (watch Statistician update board!) 7. Press Numpad 8 (check all stats) 📝 CONSOLE LOGGING: - All commands log to console - Success/warning messages - Full command list on init - Easy debugging 🚀 READY FOR FULL TESTING: - npm start - Open console (F12) - See Week 1 debug commands list - Test all 11 shortcuts! Next: Final session summary! 📚
This commit is contained in:
@@ -1249,6 +1249,172 @@ class GameScene extends Phaser.Scene {
|
||||
this.input.keyboard.on('keydown-F8', () => this.saveGame());
|
||||
this.input.keyboard.on('keydown-F9', () => this.loadGame());
|
||||
|
||||
// ========================================================
|
||||
// 🎆 WEEK 1 DEBUG COMMANDS - Test Keyboard Shortcuts
|
||||
// ========================================================
|
||||
|
||||
// F10 - Spawn Electrician NPC near player
|
||||
this.input.keyboard.on('keydown-F10', () => {
|
||||
if (this.buildingUpgradeSystem && this.player) {
|
||||
const x = this.player.gridX + 3;
|
||||
const y = this.player.gridY;
|
||||
this.buildingUpgradeSystem.spawnElectrician(x * 48, y * 48);
|
||||
console.log('⚡ Electrician spawned at player location!');
|
||||
}
|
||||
});
|
||||
|
||||
// F11 - Spawn Zombie Statistician NPC near player
|
||||
this.input.keyboard.on('keydown-F11', () => {
|
||||
if (this.cityManagementSystem && this.player) {
|
||||
const x = this.player.gridX - 3;
|
||||
const y = this.player.gridY;
|
||||
this.cityManagementSystem.spawnStatistician(x * 48, y * 48);
|
||||
console.log('👔 Zombie Statistician spawned at player location!');
|
||||
}
|
||||
});
|
||||
|
||||
// F12 - Build ALL Week 1 buildings near player
|
||||
this.input.keyboard.on('keydown-F12', () => {
|
||||
if (this.player) {
|
||||
const baseX = this.player.gridX;
|
||||
const baseY = this.player.gridY;
|
||||
|
||||
// Generator
|
||||
if (this.buildingUpgradeSystem) {
|
||||
this.buildingUpgradeSystem.buildGenerator((baseX + 5) * 48, baseY * 48);
|
||||
console.log('🏭 Generator built!');
|
||||
}
|
||||
|
||||
// City Hall
|
||||
if (this.cityManagementSystem) {
|
||||
this.cityManagementSystem.placeCityHall((baseX - 5) * 48, baseY * 48);
|
||||
console.log('🏛️ City Hall built!');
|
||||
}
|
||||
|
||||
// Population Board
|
||||
if (this.cityManagementSystem) {
|
||||
this.cityManagementSystem.placePopulationBoard((baseX - 5) * 48, (baseY + 3) * 48);
|
||||
console.log('📊 Population Board built!');
|
||||
}
|
||||
|
||||
// Resource Depot
|
||||
if (this.resourceLogisticsSystem) {
|
||||
this.resourceLogisticsSystem.addDepot((baseX) * 48, (baseY - 5) * 48);
|
||||
console.log('📦 Resource Depot built!');
|
||||
}
|
||||
|
||||
console.log('✅ All Week 1 buildings constructed!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 1 - Add test resources
|
||||
this.input.keyboard.on('keydown-NUMPAD_ONE', () => {
|
||||
if (this.resourceLogisticsSystem) {
|
||||
this.resourceLogisticsSystem.addResource('wood', 100);
|
||||
this.resourceLogisticsSystem.addResource('food', 50);
|
||||
this.resourceLogisticsSystem.addResource('stone', 75);
|
||||
console.log('💎 Added test resources: 100 wood, 50 food, 75 stone!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 2 - Drop test resources near player
|
||||
this.input.keyboard.on('keydown-NUMPAD_TWO', () => {
|
||||
if (this.resourceLogisticsSystem && this.player) {
|
||||
const x = this.player.x;
|
||||
const y = this.player.y;
|
||||
this.resourceLogisticsSystem.dropResource(x + 50, y, 'wood', 10);
|
||||
this.resourceLogisticsSystem.dropResource(x - 50, y, 'food', 5);
|
||||
this.resourceLogisticsSystem.dropResource(x, y + 50, 'stone', 8);
|
||||
console.log('📦 Dropped test resources around player!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 3 - Hire Electrician (auto)
|
||||
this.input.keyboard.on('keydown-NUMPAD_THREE', () => {
|
||||
if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) {
|
||||
this.buildingUpgradeSystem.hireElectrician();
|
||||
console.log('⚡ Electrician hired!');
|
||||
} else {
|
||||
console.warn('⚠️ Spawn Electrician first (F10)!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 4 - Hire Zombie Statistician (auto)
|
||||
this.input.keyboard.on('keydown-NUMPAD_FOUR', () => {
|
||||
if (this.cityManagementSystem && this.cityManagementSystem.statistician) {
|
||||
this.cityManagementSystem.hireStatistician();
|
||||
console.log('👔 Zombie Statistician hired!');
|
||||
} else {
|
||||
console.warn('⚠️ Spawn Zombie Statistician first (F11)!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 5 - Trigger Electrician inspection
|
||||
this.input.keyboard.on('keydown-NUMPAD_FIVE', () => {
|
||||
if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) {
|
||||
this.buildingUpgradeSystem.electricianInspectGenerator();
|
||||
console.log('⚡ Electrician inspecting generator!');
|
||||
} else {
|
||||
console.warn('⚠️ Electrician not spawned or not hired!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 6 - Trigger Electrician repair
|
||||
this.input.keyboard.on('keydown-NUMPAD_SIX', () => {
|
||||
if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) {
|
||||
this.buildingUpgradeSystem.electricianRepairGenerator();
|
||||
console.log('⚡ Electrician repairing generator!');
|
||||
} else {
|
||||
console.warn('⚠️ Electrician not spawned or not hired!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 7 - Trigger Statistician board update
|
||||
this.input.keyboard.on('keydown-NUMPAD_SEVEN', () => {
|
||||
if (this.cityManagementSystem && this.cityManagementSystem.statistician) {
|
||||
this.cityManagementSystem.statisticianUpdateBoard();
|
||||
console.log('👔 Zombie Statistician updating board!');
|
||||
} else {
|
||||
console.warn('⚠️ Zombie Statistician not spawned or not hired!');
|
||||
}
|
||||
});
|
||||
|
||||
// NUMPAD 8 - Show all Week 1 stats
|
||||
this.input.keyboard.on('keydown-NUMPAD_EIGHT', () => {
|
||||
console.log('📊 WEEK 1 SYSTEMS STATUS:');
|
||||
|
||||
if (this.resourceLogisticsSystem) {
|
||||
const resources = this.resourceLogisticsSystem.getResources();
|
||||
console.log('📦 Resources:', resources);
|
||||
}
|
||||
|
||||
if (this.cityManagementSystem) {
|
||||
const population = this.cityManagementSystem.getPopulation();
|
||||
console.log('👥 Population:', population);
|
||||
console.log('👔 Statistician employed:', this.cityManagementSystem.statisticianEmployed);
|
||||
}
|
||||
|
||||
if (this.buildingUpgradeSystem) {
|
||||
console.log('⚡ Generator health:', this.buildingUpgradeSystem.generatorHealth + '%');
|
||||
console.log('⚡ Power status:', this.buildingUpgradeSystem.isPowered ? 'ONLINE' : 'OFFLINE');
|
||||
console.log('⚡ Electrician employed:', this.buildingUpgradeSystem.electricianEmployed);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('🎮 Week 1 Debug Commands enabled!');
|
||||
console.log(' F10 = Spawn Electrician');
|
||||
console.log(' F11 = Spawn Zombie Statistician');
|
||||
console.log(' F12 = Build all Week 1 buildings');
|
||||
console.log(' Numpad 1 = Add resources');
|
||||
console.log(' Numpad 2 = Drop resources');
|
||||
console.log(' Numpad 3 = Hire Electrician');
|
||||
console.log(' Numpad 4 = Hire Statistician');
|
||||
console.log(' Numpad 5 = Electrician inspect');
|
||||
console.log(' Numpad 6 = Electrician repair');
|
||||
console.log(' Numpad 7 = Statistician update board');
|
||||
console.log(' Numpad 8 = Show all stats');
|
||||
// ========================================================
|
||||
|
||||
// Spawn Boss (Debug)
|
||||
this.input.keyboard.on('keydown-K', () => this.spawnBoss());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user