fixed restart problem
This commit is contained in:
parent
636a19f7fe
commit
1f068080e3
3 changed files with 4 additions and 10 deletions
|
@ -106,11 +106,7 @@ function addKeyListeners() {
|
|||
|
||||
|
||||
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||
$("#restartBtn").on('touchstart', function() {
|
||||
init(1);
|
||||
canRestart = false;
|
||||
});
|
||||
$("#restart").on('touchstart', function() {
|
||||
$("#restart").on('touchstart', function() {
|
||||
init();
|
||||
canRestart = false;
|
||||
$("#gameoverscreen").fadeOut();
|
||||
|
@ -118,10 +114,6 @@ function addKeyListeners() {
|
|||
|
||||
}
|
||||
else {
|
||||
$("#restartBtn").on('mousedown', function() {
|
||||
init(1);
|
||||
canRestart = false;
|
||||
});
|
||||
$("#restart").on('mousedown', function() {
|
||||
init();
|
||||
canRestart = false;
|
||||
|
|
|
@ -70,7 +70,7 @@ function init(b) {
|
|||
if (b) {
|
||||
|
||||
|
||||
$("#pauseBtn").attr('src',"./images/btn_pause.svg");
|
||||
$("#pauseBtn").attr('src',"./images/btn_pause.svg");
|
||||
if ($('#helpScreen').is(":visible")) {
|
||||
$('#helpScreen').fadeOut(150, "linear");
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ function init(b) {
|
|||
clearSaveState();
|
||||
checkVisualElements();
|
||||
}
|
||||
checkVisualElements();
|
||||
if (highscores.length === 0 ){
|
||||
$("#currentHighScore").text(0);
|
||||
}
|
||||
|
|
|
@ -175,6 +175,7 @@ function gameOverDisplay() {
|
|||
}
|
||||
|
||||
}
|
||||
settings.ending_block=false;
|
||||
Cookies.set("visited",true);
|
||||
var c = document.getElementById("canvas");
|
||||
c.className = "blur";
|
||||
|
|
Loading…
Reference in a new issue