Spaces:
Running
Running
debug
Browse files- src/main.js +33 -0
src/main.js
CHANGED
|
@@ -29,6 +29,39 @@ const effectSystem = new EffectSystem(sceneSetup.scene);
|
|
| 29 |
// Make UIManager globally accessible for tower sound system
|
| 30 |
window.UIManager = uiManager;
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
// Build the path
|
| 33 |
pathBuilder.buildPath();
|
| 34 |
|
|
|
|
| 29 |
// Make UIManager globally accessible for tower sound system
|
| 30 |
window.UIManager = uiManager;
|
| 31 |
|
| 32 |
+
// Add debug methods to window for console access
|
| 33 |
+
window.debug = {
|
| 34 |
+
addMoney: (amount) => {
|
| 35 |
+
gameState.addMoney(amount);
|
| 36 |
+
uiManager.updateHUD(gameState);
|
| 37 |
+
console.log(`Added ${amount} money. Current: ${gameState.money}`);
|
| 38 |
+
},
|
| 39 |
+
setMoney: (amount) => {
|
| 40 |
+
gameState.setMoney(amount);
|
| 41 |
+
uiManager.updateHUD(gameState);
|
| 42 |
+
console.log(`Set money to ${amount}`);
|
| 43 |
+
},
|
| 44 |
+
getMoney: () => {
|
| 45 |
+
console.log(`Current money: ${gameState.money}`);
|
| 46 |
+
return gameState.money;
|
| 47 |
+
},
|
| 48 |
+
setLives: (amount) => {
|
| 49 |
+
gameState.lives = amount;
|
| 50 |
+
uiManager.updateHUD(gameState);
|
| 51 |
+
console.log(`Set lives to ${amount}`);
|
| 52 |
+
},
|
| 53 |
+
getLives: () => {
|
| 54 |
+
console.log(`Current lives: ${gameState.lives}`);
|
| 55 |
+
return gameState.lives;
|
| 56 |
+
},
|
| 57 |
+
getGameState: () => gameState,
|
| 58 |
+
skipToWave: (waveNum) => {
|
| 59 |
+
gameState.waveIndex = waveNum - 1;
|
| 60 |
+
uiManager.updateHUD(gameState);
|
| 61 |
+
console.log(`Skipped to wave ${waveNum}`);
|
| 62 |
+
}
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
// Build the path
|
| 66 |
pathBuilder.buildPath();
|
| 67 |
|