From 1f068080e3f77c4d02fd1d8bfe4298f328d7a8f6 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Wed, 26 Aug 2015 21:57:52 -0400 Subject: [PATCH] fixed restart problem --- js_v9/input.js | 10 +--------- js_v9/main.js | 3 ++- js_v9/view.js | 1 + 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/js_v9/input.js b/js_v9/input.js index 9bfaf2c..994f0c7 100644 --- a/js_v9/input.js +++ b/js_v9/input.js @@ -106,11 +106,7 @@ function addKeyListeners() { if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { - $("#restartBtn").on('touchstart', function() { - init(1); - canRestart = false; - }); - $("#restart").on('touchstart', function() { + $("#restart").on('touchstart', function() { init(); canRestart = false; $("#gameoverscreen").fadeOut(); @@ -118,10 +114,6 @@ function addKeyListeners() { } else { - $("#restartBtn").on('mousedown', function() { - init(1); - canRestart = false; - }); $("#restart").on('mousedown', function() { init(); canRestart = false; diff --git a/js_v9/main.js b/js_v9/main.js index 8492c39..7606b48 100644 --- a/js_v9/main.js +++ b/js_v9/main.js @@ -70,7 +70,7 @@ function init(b) { if (b) { - $("#pauseBtn").attr('src',"./images/btn_pause.svg"); + $("#pauseBtn").attr('src',"./images/btn_pause.svg"); if ($('#helpScreen').is(":visible")) { $('#helpScreen').fadeOut(150, "linear"); } @@ -82,6 +82,7 @@ function init(b) { clearSaveState(); checkVisualElements(); } + checkVisualElements(); if (highscores.length === 0 ){ $("#currentHighScore").text(0); } diff --git a/js_v9/view.js b/js_v9/view.js index dc8552c..7467bb4 100644 --- a/js_v9/view.js +++ b/js_v9/view.js @@ -175,6 +175,7 @@ function gameOverDisplay() { } } + settings.ending_block=false; Cookies.set("visited",true); var c = document.getElementById("canvas"); c.className = "blur";