From 27b3923d880ed7b89f141cac7ab51443830891b5 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Sat, 14 Mar 2015 13:21:21 -0400 Subject: [PATCH 1/2] Added assets --- images/btn_back.svg | 15 +++++++++++++++ images/btn_facebook.svg | 19 +++++++++++++++++++ images/btn_help.svg | 17 +++++++++++++++++ images/btn_pause.svg | 15 +++++++++++++++ images/btn_restart.svg | 15 +++++++++++++++ images/btn_resume.svg | 15 +++++++++++++++ images/btn_share.svg | 17 +++++++++++++++++ images/btn_twitter.svg | 19 +++++++++++++++++++ images/icon_arrows.svg | 14 ++++++++++++++ js_v9/view.js | 1 + 10 files changed, 147 insertions(+) create mode 100644 images/btn_back.svg create mode 100644 images/btn_facebook.svg create mode 100644 images/btn_help.svg create mode 100644 images/btn_pause.svg create mode 100644 images/btn_restart.svg create mode 100644 images/btn_resume.svg create mode 100644 images/btn_share.svg create mode 100644 images/btn_twitter.svg create mode 100644 images/icon_arrows.svg diff --git a/images/btn_back.svg b/images/btn_back.svg new file mode 100644 index 0000000..97db82e --- /dev/null +++ b/images/btn_back.svg @@ -0,0 +1,15 @@ + + + + Back button + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_facebook.svg b/images/btn_facebook.svg new file mode 100644 index 0000000..42421cc --- /dev/null +++ b/images/btn_facebook.svg @@ -0,0 +1,19 @@ + + + + Facebook + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_help.svg b/images/btn_help.svg new file mode 100644 index 0000000..6859881 --- /dev/null +++ b/images/btn_help.svg @@ -0,0 +1,17 @@ + + + + Help + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_pause.svg b/images/btn_pause.svg new file mode 100644 index 0000000..08d6e56 --- /dev/null +++ b/images/btn_pause.svg @@ -0,0 +1,15 @@ + + + + Pause button + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_restart.svg b/images/btn_restart.svg new file mode 100644 index 0000000..0c5246a --- /dev/null +++ b/images/btn_restart.svg @@ -0,0 +1,15 @@ + + + + Restart button + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_resume.svg b/images/btn_resume.svg new file mode 100644 index 0000000..bb963f2 --- /dev/null +++ b/images/btn_resume.svg @@ -0,0 +1,15 @@ + + + + Resume button + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/images/btn_share.svg b/images/btn_share.svg new file mode 100644 index 0000000..9607e85 --- /dev/null +++ b/images/btn_share.svg @@ -0,0 +1,17 @@ + + + + Share button + Created with Sketch. + + + + + + + SHARE MY SCORE! + + + + + \ No newline at end of file diff --git a/images/btn_twitter.svg b/images/btn_twitter.svg new file mode 100644 index 0000000..868cfab --- /dev/null +++ b/images/btn_twitter.svg @@ -0,0 +1,19 @@ + + + + Twitter + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/icon_arrows.svg b/images/icon_arrows.svg new file mode 100644 index 0000000..11d6530 --- /dev/null +++ b/images/icon_arrows.svg @@ -0,0 +1,14 @@ + + + + Arrows icon + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/js_v9/view.js b/js_v9/view.js index 5443024..8874a7c 100644 --- a/js_v9/view.js +++ b/js_v9/view.js @@ -215,6 +215,7 @@ function gameOverDisplay() { } function pause(o) { + alert("pausing"); writeHighScores(); var message; if (o) { From a2df6064bebda6210171ca4238e747882cf59cf3 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Sat, 14 Mar 2015 13:53:21 -0400 Subject: [PATCH 2/2] fixed pause button --- index.html | 3 +-- js_v9/input.js | 3 ++- js_v9/main.js | 4 ++-- js_v9/view.js | 11 +++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 2db17c8..2ca4a76 100644 --- a/index.html +++ b/index.html @@ -82,8 +82,7 @@
-
-
+
diff --git a/js_v9/input.js b/js_v9/input.js index a095099..b7431d5 100644 --- a/js_v9/input.js +++ b/js_v9/input.js @@ -75,6 +75,8 @@ function addKeyListeners() { }); $("#pauseBtn").on('touchstart mousedown', function() { + + alert("hey"); if (gameState != 1 && gameState != -1) { return; } @@ -82,7 +84,6 @@ function addKeyListeners() { if ($('#helpScreen').is(":visible")) { $('#helpScreen').fadeOut(150, "linear"); } - alert("hey"); pause(); return false; }); diff --git a/js_v9/main.js b/js_v9/main.js index 73c081b..22aa1ee 100644 --- a/js_v9/main.js +++ b/js_v9/main.js @@ -83,7 +83,7 @@ function init(b) { } infobuttonfading = true; - $("#pauseBtnInner").html(''); + $("#pauseBtn").html(''); hideUIElements(); var saveState = localStorage.getItem("saveState") || "{}"; saveState = JSONfn.parse(saveState); @@ -331,7 +331,7 @@ function showHelp() { pause(); } - if($("#pauseBtnInner").children()[0].src.replace(/^.*[\\\/]/, '') == "btn_pause.svg" && gameState != 0 && !infobuttonfading) { + if($("#pauseBtn").children()[0].src.replace(/^.*[\\\/]/, '') == "btn_pause.svg" && gameState != 0 && !infobuttonfading) { return; } diff --git a/js_v9/view.js b/js_v9/view.js index 8874a7c..9da86db 100644 --- a/js_v9/view.js +++ b/js_v9/view.js @@ -155,10 +155,10 @@ function setMainMenu() { canRestart = 's'; }, 500); $('#restartBtn').hide(); - if ($($("#pauseBtn").children()[0]).replace(/^.*[\\\/]/, '') == "btn_pause.svg") { - $("#pauseBtnInner").html(''); + if ($("#pauseBtn").replace(/^.*[\\\/]/, '') == "btn_pause.svg") { + $("#pauseBtn").attr("src","./images/btn_resume.svg"); } else { - $("#pauseBtnInner").html(''); + $("#pauseBtn").attr("src","./images/btn_pause.svg"); } } @@ -215,7 +215,6 @@ function gameOverDisplay() { } function pause(o) { - alert("pausing"); writeHighScores(); var message; if (o) { @@ -231,7 +230,7 @@ function pause(o) { $('#helpScreen').fadeOut(150, "linear"); } - $("#pauseBtnInner").html(''); + $("#pauseBtn").attr("src", "./images/btn_pause.svg"); $('.helpText').fadeOut(200, 'linear'); hideText(); hidebottombar(); @@ -246,7 +245,7 @@ function pause(o) { showText(message); } - $("#pauseBtnInner").html(''); + $("#pauseBtn").attr("src","./images/btn_resume.svg"); prevGameState = gameState; gameState = -1; }