Merge branch 'gh-pages' of https://github.com/teamsnowman/hextris into gh-pages
This commit is contained in:
commit
18d1c6e6a9
2 changed files with 15 additions and 6 deletions
19
js/main.js
19
js/main.js
|
@ -9,16 +9,25 @@ $(document).ready(function(){
|
|||
}
|
||||
|
||||
setTimeout(function(){
|
||||
document.body.addEventListener('touchstart', function(e) {
|
||||
handleClickTap(e.changedTouches[0].clientX);
|
||||
}, false);
|
||||
if(settings.platform == "mobile"){
|
||||
document.body.addEventListener('touchstart', function(e) {
|
||||
handleClickTap(e.changedTouches[0].clientX);
|
||||
}, false);
|
||||
}
|
||||
else{
|
||||
document.body.addEventListener('mousedown', function(e) {
|
||||
handleClickTap(e.changedTouches[0].clientX);
|
||||
}, false);
|
||||
|
||||
}
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
$(window).resize(scaleCanvas);
|
||||
$(window).unload(function(){
|
||||
localStorage.setItem("saveState", exportSaveState());
|
||||
if(gameState ==1 || gameState ==-1) localStorage.setItem("saveState", exportSaveState());
|
||||
else localStorage.clear();
|
||||
});
|
||||
|
||||
function scaleCanvas() {
|
||||
|
@ -404,4 +413,4 @@ function showHelp(){
|
|||
}
|
||||
|
||||
$('#helpScreen').fadeToggle(150, "linear");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ function showText(text){
|
|||
'paused':"<div class='centeredHeader unselectable'>Paused</div><br><div class='unselectable centeredSubHeader'>Press p to resume</div>",
|
||||
'pausedMobile':"<div class='centeredHeader unselectable'>Paused</div>",
|
||||
'start':"<div class='centeredHeader unselectable' style='line-height:80px;' >Press enter to start</div>",
|
||||
'gameover':"<div class='centeredHeader unselectable'> Game Over: "+score+" pts</div><br><table class='tg' style='margin:0px auto'> <tr> <th class='tg-031e'>1.</th> <th class='tg-031e'>"+highscores[0]+"</th> </tr> <tr> <td class='tg-031e'>2.</td> <th class='tg-031e'>"+highscores[1]+"</th> </tr> <tr> <td class='tg-031e'>3.</td> <th class='tg-031e'>"+highscores[2]+"</th> </tr> </table><br><div class='unselectable centeredSubHeader'>Press enter to restart</div>",
|
||||
'gameover':"<div class='centeredHeader unselectable'> Game Over: "+score+" pts</div><br><div style='font-size:24px;' class='centeredHeader unselectable'> High Scores:</div><table class='tg' style='margin:0px auto'> <tr> <th class='tg-031e'>1.</th> <th class='tg-031e'>"+highscores[0]+"</th> </tr> <tr> <td class='tg-031e'>2.</td> <th class='tg-031e'>"+highscores[1]+"</th> </tr> <tr> <td class='tg-031e'>3.</td> <th class='tg-031e'>"+highscores[2]+"</th> </tr> </table><br><div class='unselectable centeredSubHeader'>Press enter to restart</div>",
|
||||
};
|
||||
|
||||
var pt = document.getElementById("overlay");
|
||||
|
|
Loading…
Reference in a new issue