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:
@@ -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");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user