From 4e6e49d99148a137ae448c5425dabeddea876109 Mon Sep 17 00:00:00 2001
From: meadowstream
Date: Wed, 16 Jul 2014 00:08:57 -0400
Subject: [PATCH 1/2] added fading helpText, removed old ogg declarations
---
index.html | 2 +-
js/main.js | 10 +++++-----
js/view.js | 6 ------
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/index.html b/index.html
index 80ed3d9..ede65e4 100644
--- a/index.html
+++ b/index.html
@@ -64,7 +64,7 @@
Found a bug? Go here
-
+
diff --git a/js/main.js b/js/main.js
index cd81441..d89ba74 100644
--- a/js/main.js
+++ b/js/main.js
@@ -161,7 +161,7 @@ function resumeGame() {
importing = 0;
startTime = Date.now();
setTimeout(function(){
- $('#helpText').fadeOut(150, "linear");
+ $('.helpText').fadeOut(150, "linear");
}, 7000);
if ($('#helpScreen').is(":visible")) {
$('#helpScreen').fadeOut(150, "linear");
@@ -176,8 +176,8 @@ function hideUIElements() {
function init(b) {
if (b) {
- if (!$('#helpText').is(":visible")) {
- $('#helpText').fadeIn(150, "linear");
+ if (!$('.helpText').is(":visible")) {
+ $('.helpText').fadeIn(150, "linear");
}
if ($('#helpScreen').is(":visible")) {
@@ -185,7 +185,7 @@ function init(b) {
}
setTimeout(function() {
- $('#helpText').fadeOut(150, "linear");
+ $('.helpText').fadeOut(150, "linear");
}, 7000);
clearSaveState();
}
@@ -345,7 +345,7 @@ function animLoop() {
}
render();
if (checkGameOver() && !importing) {
- $('#helpText').fadeIn(200, "linear");
+ $('.helpText').fadeIn(200, "linear");
gameState = 2;
setTimeout(function(){
enableRestart();
diff --git a/js/view.js b/js/view.js
index bd7df95..714d240 100644
--- a/js/view.js
+++ b/js/view.js
@@ -32,12 +32,6 @@ function easeOutCubic(t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
}
-var colorSounds = {"#e74c3c": new Audio("../sounds/lowest.ogg"),
-"#f1c40f":new Audio("../sounds/highest.ogg"),
-"#3498db":new Audio("../sounds/middle.ogg"),
- "#2ecc71":new Audio("../sounds/highest.ogg") //fix this later
-};
-
function renderText(x, y, fontSize, color, text, font) {
ctx.save();
if (!font) {
From 5f76602aaf94d4f83cf8886cc9a9709981057272 Mon Sep 17 00:00:00 2001
From: Garrett Finucane
Date: Wed, 16 Jul 2014 10:37:12 -0400
Subject: [PATCH 2/2] fixed touble restart on mobile
---
index.html | 2 +-
js/input.js | 31 +++++++++++++++++++++++--------
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/index.html b/index.html
index ede65e4..c2b7a9a 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
-
+
Click to exit
diff --git a/js/input.js b/js/input.js
index 35475a3..983ed7c 100644
--- a/js/input.js
+++ b/js/input.js
@@ -105,15 +105,30 @@ $(document).ready(function(){
return false;
});
- $("#restartBtn").on('touchstart mousedown', function() {
- if (gameState==2 || gameState==1 || importing == 1) {
- init(1);
- }
- if (gameState===0) {
- resumeGame();
- }
+ 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;
+ }
+ 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();
+ }
+
+ });
+ }
}, false);