Permalink
Browse files

Adding a gameStage for things like GAME_ON and GAME_OVER

  • Loading branch information...
1 parent c3728d1 commit 11dd7019073d6eae8cec64caa15fc62b93e0e6d4 @presstube committed Oct 26, 2011
Showing with 9 additions and 2 deletions.
  1. +8 −1 src/hunted/HuntedApp.js
  2. +1 −1 src/hunted/Launcher.js
@@ -3,6 +3,7 @@
var HuntedApp = function() {
var that = this,
+ gameState = "GAME_OVER",
numChasersToSpawn = 1,
paused = false,
wrapRadius = 2000,
@@ -105,7 +106,11 @@
checkForHits();
stage.update();
// set scaleStage's setScaleMultiplier with nav's getDistMultiplier()
- scaleStage.setScaleMultiplier(nav.getDistMultiplier());
+ if (gameState == "GAME_ON") {
+ scaleStage.setScaleMultiplier(nav.getDistMultiplier());
+ } else {
+ scaleStage.setScaleMultiplier(1);
+ }
};
}
@@ -114,6 +119,7 @@
}
function start() {
+ gameState = "GAME_ON";
// _.each(chasers, function(chaser){ chaser.kill(); });
// chasers = [];
while (chasers.length > 0) {
@@ -129,6 +135,7 @@
}
function gameOver() {
+ gameState = "GAME_OVER";
// while (chasers.length > 0) {
// chasers.pop().kill();
// }
@@ -64,7 +64,7 @@
function killProjectile(projectile) {
_p.trackingStage.removeChild(projectile);
_p.projectiles.splice(_.indexOf(_p.projectiles, projectile), 1);
- console.log("killing projectile");
+ // console.log("killing projectile");
}

0 comments on commit 11dd701

Please sign in to comment.