refactor code

This commit is contained in:
Gabriele Cirulli
2014-03-14 13:27:57 +01:00
parent a831baed58
commit cfbf74905f
3 changed files with 9 additions and 14 deletions
+6 -8
View File
@@ -15,25 +15,23 @@ function GameManager(size, InputManager, Actuator, ScoreManager) {
// Restart the game
GameManager.prototype.restart = function () {
this.actuator.restart();
this.actuator.continue();
this.setup();
};
// Keep playing after winning
GameManager.prototype.keepPlaying = function () {
this.keepPlaying = true;
this.actuator.keepPlaying();
this.actuator.continue();
};
GameManager.prototype.isGameOver = function() {
if (this.over || (this.won && !this.keepPlaying) ) {
GameManager.prototype.isGameOver = function () {
if (this.over || (this.won && !this.keepPlaying)) {
return true;
}
else {
} else {
return false;
}
}
};
// Set up the game
GameManager.prototype.setup = function () {