From 78fe31577e445a5c629b5a27731195fbaf235593 Mon Sep 17 00:00:00 2001 From: meadowstream Date: Sun, 27 Jul 2014 19:10:40 -0400 Subject: [PATCH] removed debugger statements. made larger hitboxes for buttons. fixed garrett's github link. --- index.html | 8 ++++---- js/initialization.js | 10 +++++++--- js/save-state.js | 2 -- js/view.js | 22 +++++++++++----------- style/style.css | 12 ++++++++++++ 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 45408ec..9173cf1 100644 --- a/index.html +++ b/index.html @@ -33,8 +33,8 @@
-
Started by @teamsnowman at HackExeter
- Finished by Garrett Finucane & Logan Engstrom on GitHub +
@@ -67,8 +67,8 @@
Help
-
-
+
+
diff --git a/js/initialization.js b/js/initialization.js index 79a2cb1..1525712 100644 --- a/js/initialization.js +++ b/js/initialization.js @@ -123,9 +123,13 @@ function initialize(a) { window.numHighScores = 3; window.highscores = []; - debugger; - if(localStorage.getItem('highscores')) - highscores = JSON.parse(localStorage.getItem('highscores')); + if(localStorage.getItem('highscores')) { + try { + highscores = JSON.parse(localStorage.getItem('highscores')); + } catch (e) { + highscores = []; + } + } writeHighScores(); diff --git a/js/save-state.js b/js/save-state.js index 205dec9..fbdd9ec 100644 --- a/js/save-state.js +++ b/js/save-state.js @@ -39,8 +39,6 @@ function descaleBlock(b) { function writeHighScores() { if (Object.prototype.toString.call(highscores) === '[object Array]') { localStorage.setItem("highscores", JSON.stringify(highscores)); - } else { - debugger; } } diff --git a/js/view.js b/js/view.js index a6fb571..fe1f4b4 100644 --- a/js/view.js +++ b/js/view.js @@ -84,10 +84,16 @@ function toggleClass(element, active) { function showText(text){ var messages = { 'paused':"
Paused

Press p to resume
", - 'pausedMobile':"
Paused
", + 'pausedMobile':"
Paused

Press to resume
", 'start':"
Press enter to start
", 'gameover':"
Game Over: "+score+" pts

High Scores:
" }; + + if (text == 'paused') { + if (settings.platform == 'mobile') { + text = 'pausedMobile'; + } + } if (text == 'gameover') { var allZ = 1; @@ -119,12 +125,6 @@ function showText(text){ } $("#overlay").html(messages[text]); $("#overlay").fadeIn("1000","swing"); - if (text == 'paused') { - if (settings.platform == 'mobile') { - text = 'pausedMobile'; - } - } - if (text == 'gameover') { if (settings.platform == 'mobile') { @@ -141,9 +141,9 @@ function setMainMenu() { }, 500); $('#restartBtn').show(); if ($($("#pauseBtn").children()[0]).attr('class').indexOf('pause') == -1) { - $("#pauseBtn").html(''); + $("#pauseBtnInner").html(''); } else { - $("#pauseBtn").html(''); + $("#pauseBtnInner").html(''); } } @@ -174,7 +174,7 @@ function pause(o) { $('#helpScreen').fadeOut(150, "linear"); } - $("#pauseBtn").html(''); + $("#pauseBtnInner").html(''); $('.helpText').fadeOut(200, 'linear'); hideText(); hidebottombar(); @@ -190,7 +190,7 @@ function pause(o) { showText(message); } - $("#pauseBtn").html(''); + $("#pauseBtnInner").html(''); prevGameState = gameState; gameState = -1; } diff --git a/style/style.css b/style/style.css index 447d2e4..a33b61b 100644 --- a/style/style.css +++ b/style/style.css @@ -73,6 +73,8 @@ button:focus { #pauseBtn { position: absolute; margin-bottom: 3px; + width:60px; + height:60px; margin-right: 7px; z-index: 3000; color:#232323; @@ -81,12 +83,22 @@ button:focus { right:0; bottom:0; z-index:99; +} +#pauseBtnInner { + margin-left:35px; + margin-top:28px; +} + +#restartBtnInner { + margin-top:28px; } #restartBtn { position:absolute; left:0; + width:60px; + height:60px; bottom:0; z-index:99; position: absolute;