Endless Game. Allow user to continue the game.

- main.css isn't compiled
- a special class `.tile-gold` is added to tiles above 2048
This commit is contained in:
Laurent Margirier
2014-03-12 12:27:27 +01:00
parent da75b7a44e
commit 9626e2b060
5 changed files with 62 additions and 9 deletions
+9 -1
View File
@@ -53,10 +53,13 @@ KeyboardInputManager.prototype.listen = function () {
}
});
var retry = document.getElementsByClassName("retry-button")[0];
var retry = document.querySelector(".retry-button");
retry.addEventListener("click", this.restart.bind(this));
retry.addEventListener("touchend", this.restart.bind(this));
var keepPlaying = document.querySelector(".keep-playing-button");
keepPlaying.addEventListener("click", this.keepPlaying.bind(this));
// Listen to swipe events
var touchStartClientX, touchStartClientY;
var gameContainer = document.getElementsByClassName("game-container")[0];
@@ -93,3 +96,8 @@ KeyboardInputManager.prototype.restart = function (event) {
event.preventDefault();
this.emit("restart");
};
KeyboardInputManager.prototype.keepPlaying = function (event) {
event.preventDefault();
this.emit("keepPlaying");
};