removed redundant code, removed debugger statements
This commit is contained in:
parent
b9cb183eb8
commit
e4de6dab2a
4 changed files with 13 additions and 34 deletions
|
@ -75,26 +75,25 @@ function addKeyListeners() {
|
|||
|
||||
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
||||
$("#restartBtn").on('touchstart', function() {
|
||||
if (gameState==2 || gameState == -1 || gameState==1 || importing == 1) {
|
||||
if (gameState==2 || gameState==1 || importing == 1) {
|
||||
init(1);
|
||||
canRestart = false;
|
||||
}
|
||||
else if (gameState===0) {
|
||||
init(1)();
|
||||
resumeGame();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#restartBtn").on('mousedown', function() {
|
||||
if (gameState==2 || gameState == -1 || gameState==1 || importing == 1) {
|
||||
if (gameState==2 || gameState==1 || importing == 1) {
|
||||
init(1);
|
||||
canRestart=false;
|
||||
canRestart = false;
|
||||
}
|
||||
else if (gameState===0) {
|
||||
resumeGame();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,7 +287,6 @@ function enableRestart() {
|
|||
}
|
||||
|
||||
function updateHighScore(){
|
||||
//debugger;
|
||||
for(var i = 0; i<numHighScores;i++) {
|
||||
if(highscores[i]<=score) {
|
||||
highscores.splice(i,0,score);
|
||||
|
@ -303,8 +302,9 @@ function isInfringing(hex){
|
|||
for(var i=0;i<hex.sides;i++){
|
||||
var subTotal=0;
|
||||
for (var j=0;j<hex.blocks[i].length;j++){
|
||||
subTotal+=hex.blocks[i][j].deleted ;
|
||||
subTotal+=hex.blocks[i][j].deleted;
|
||||
}
|
||||
|
||||
if (hex.blocks[i].length- subTotal>settings.rows){
|
||||
return true;
|
||||
}
|
||||
|
|
29
js/view.js
29
js/view.js
|
@ -103,7 +103,6 @@ function showText(text){
|
|||
if (text == 'gameover') {
|
||||
var allZ = 1;
|
||||
var i;
|
||||
console.log(highscores);
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (highscores[i] !== undefined && (highscores[i] != 0 || (highscores[0] == 0 && i==0))) {
|
||||
messages['gameover'] += "<tr> <th class='tg-031e'>"+(i+1)+".</th> <th class='tg-031e'>"+highscores[i] + " pts</th> </tr>";
|
||||
|
@ -139,31 +138,11 @@ function showText(text){
|
|||
|
||||
pt.innerHTML = messages[text];
|
||||
|
||||
|
||||
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
||||
$("#restartBtn").on('touchstart', function() {
|
||||
if (gameState==2 || gameState==1 || importing == 1) {
|
||||
init(1);
|
||||
canRestart = false;
|
||||
}
|
||||
else if (gameState===0) {
|
||||
resumeGame();
|
||||
}
|
||||
|
||||
});
|
||||
if (text == 'gameover') {
|
||||
if (settings.platform == 'mobile') {
|
||||
$('.tg').css('margin-top', '4px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#restartBtn").on('mousedown', function() {
|
||||
if (gameState==2 || gameState==1 || importing == 1) {
|
||||
init(1);
|
||||
canRestart = false;
|
||||
}
|
||||
else if (gameState===0) {
|
||||
resumeGame();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setMainMenu() {
|
||||
|
|
|
@ -187,6 +187,7 @@ and (max-device-width : 480px) {
|
|||
font-size:1.25em;
|
||||
z-index:98;
|
||||
}
|
||||
|
||||
@media only screen
|
||||
and (min-device-width : 320px)
|
||||
and (max-device-width : 580px) {
|
||||
|
@ -207,7 +208,7 @@ and (max-device-width : 580px) {
|
|||
|
||||
#overlay {
|
||||
margin-top: -20%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.blur {
|
||||
opacity:0.1;
|
||||
|
@ -278,4 +279,4 @@ body {
|
|||
margin-left:-500px;
|
||||
bottom:10px;
|
||||
z-index:98;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue