changed restart btn to always restart the game instead of sometimes also resuming
This commit is contained in:
parent
38e7423f24
commit
4f15bfa423
1 changed files with 4 additions and 15 deletions
19
js/input.js
19
js/input.js
|
@ -75,25 +75,14 @@ function addKeyListeners() {
|
||||||
|
|
||||||
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
||||||
$("#restartBtn").on('touchstart', function() {
|
$("#restartBtn").on('touchstart', function() {
|
||||||
if (gameState==2 || gameState==1 || importing == 1) {
|
init(1);
|
||||||
init(1);
|
canRestart = false;
|
||||||
canRestart = false;
|
|
||||||
}
|
|
||||||
else if (gameState===0) {
|
|
||||||
resumeGame();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#restartBtn").on('mousedown', function() {
|
$("#restartBtn").on('mousedown', function() {
|
||||||
if (gameState==2 || gameState==1 || importing == 1) {
|
init(1);
|
||||||
init(1);
|
canRestart = false;
|
||||||
canRestart = false;
|
|
||||||
}
|
|
||||||
else if (gameState===0) {
|
|
||||||
resumeGame();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue