Merge branch 'gh-pages' of http://github.com/hextris/hextris into gh-pages

This commit is contained in:
Garrett Finucane 2014-07-22 22:19:42 -04:00
commit 6a41ef0d45
4 changed files with 13 additions and 34 deletions

View file

@ -75,19 +75,7 @@ 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) {
init(1);
canRestart = false;
}
else if (gameState===0) {
init(1)();
}
});
}
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;
}
@ -97,6 +85,17 @@ function addKeyListeners() {
});
}
else {
$("#restartBtn").on('mousedown', function() {
if (gameState==2 || gameState==1 || importing == 1) {
init(1);
canRestart = false;
}
else if (gameState===0) {
resumeGame();
}
});
}
}
function handleClickTap(x) {
if (gameState == 2 && canRestart) {

View file

@ -286,7 +286,6 @@ function enableRestart() {
}
function updateHighScore(){
//debugger;
for(var i = 0; i<numHighScores;i++) {
if(highscores[i]<=score) {
highscores.splice(i,0,score);
@ -304,6 +303,7 @@ function isInfringing(hex){
for (var j=0;j<hex.blocks[i].length;j++){
subTotal+=hex.blocks[i][j].deleted;
}
if (hex.blocks[i].length- subTotal>settings.rows){
return true;
}

View file

@ -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>";
@ -136,31 +135,11 @@ function showText(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;
if (text == 'gameover') {
if (settings.platform == 'mobile') {
$('.tg').css('margin-top', '4px');
}
else if (gameState===0) {
resumeGame();
}
});
}
else {
$("#restartBtn").on('mousedown', function() {
if (gameState==2 || gameState==1 || importing == 1) {
init(1);
canRestart = false;
}
else if (gameState===0) {
resumeGame();
}
});
}
}
function setMainMenu() {

View file

@ -179,6 +179,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) {