diff options
Diffstat (limited to 'html/tower/js/gameState.js')
-rw-r--r-- | html/tower/js/gameState.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/html/tower/js/gameState.js b/html/tower/js/gameState.js index 49708ee..0f379f6 100644 --- a/html/tower/js/gameState.js +++ b/html/tower/js/gameState.js @@ -111,4 +111,14 @@ function createParticle(type, position, angle) { // Add to gameState object gameState.particles = []; -gameState.projectiles = []; \ No newline at end of file +gameState.projectiles = []; +gameState.enemiesDestroyed = 0; +gameState.enemiesEscaped = 0; +gameState.path = []; // This will be populated when the path is generated + +gameState.awardEnemyDestroyed = function() { + this.enemiesDestroyed++; + // Random reward between 5 and 10 + const reward = Math.floor(Math.random() * 6) + 5; + this.currency += reward; +}; \ No newline at end of file |