Skip to content

Commit

Permalink
Adding a gameStage for things like GAME_ON and GAME_OVER
Browse files Browse the repository at this point in the history
  • Loading branch information
presstube committed Oct 26, 2011
1 parent c3728d1 commit 11dd701
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/hunted/HuntedApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var HuntedApp = function() {

var that = this,
gameState = "GAME_OVER",
numChasersToSpawn = 1,
paused = false,
wrapRadius = 2000,
Expand Down Expand Up @@ -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);
}
};
}

Expand All @@ -114,6 +119,7 @@
}

function start() {
gameState = "GAME_ON";
// _.each(chasers, function(chaser){ chaser.kill(); });
// chasers = [];
while (chasers.length > 0) {
Expand All @@ -129,6 +135,7 @@
}

function gameOver() {
gameState = "GAME_OVER";
// while (chasers.length > 0) {
// chasers.pop().kill();
// }
Expand Down
2 changes: 1 addition & 1 deletion src/hunted/Launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down

0 comments on commit 11dd701

Please sign in to comment.