From d8420a753e28b925a4d0e15c52029a637e9ee3a3 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Tue, 1 Jul 2014 11:02:52 -0400 Subject: [PATCH 1/2] no more -2 gameState --- js/entities.js | 12 ------------ js/main.js | 25 +------------------------ js/view.js | 12 ++++++++++++ 3 files changed, 13 insertions(+), 36 deletions(-) delete mode 100644 js/entities.js diff --git a/js/entities.js b/js/entities.js deleted file mode 100644 index 4ea050d..0000000 --- a/js/entities.js +++ /dev/null @@ -1,12 +0,0 @@ -var angularVelocityConst = 4; - -// t: current time, b: begInnIng value, c: change In value, d: duration -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 -}; \ No newline at end of file diff --git a/js/main.js b/js/main.js index f05aac2..fa6bad2 100644 --- a/js/main.js +++ b/js/main.js @@ -178,7 +178,7 @@ function init(b) { spawnLane = 0; op = 0; scoreOpacity = 0; - gameState = -2; + gameState = 1; if(saveState.clock !== undefined) gameState = 1; scaleCanvas(); @@ -280,21 +280,6 @@ function exportHistory() { toggleDevTools(); } -function stepInitialLoad() { - var dy = getStepDY(Date.now() - startTime, 0, (100 + trueCanvas.height/2), 1300); - if (Date.now() - startTime > 1300) { - MainClock.dy = 0; - MainClock.y = (trueCanvas.height/2); - if (Date.now() - startTime - 500 > 1300) { - $('#pauseBtn').show(); - $('#restartBtn').show(); - gameState = 1; - } - } else { - MainClock.dy = dy; - } -} - function setStartScreen() { $('#startBtn').show(); if (!isStateSaved()) { @@ -341,14 +326,6 @@ function animLoop() { render(); break; - case -2: - requestAnimFrame(animLoop); - settings.hexWidth = settings.baseHexWidth * settings.scale; - settings.blockHeight = settings.baseBlockHeight * settings.scale; - stepInitialLoad(); - render(); - break; - case -1: requestAnimFrame(animLoop); render(); diff --git a/js/view.js b/js/view.js index 12cfb20..06aa593 100644 --- a/js/view.js +++ b/js/view.js @@ -25,6 +25,18 @@ var rgbColorsToTintedColors = { var hexagonBackgroundColor = 'rgb(236, 240, 241)'; var hexagonBackgroundColorClear = 'rgba(236, 240, 241, 0.5)'; var centerBlue = 'rgb(44,62,80)'; //tumblr? +var angularVelocityConst = 4; + +// t: current time, b: begInnIng value, c: change In value, d: duration +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) { if (!font) { From 01e84ce186908e1cd06d1155c150525a924d1552 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Tue, 1 Jul 2014 11:18:13 -0400 Subject: [PATCH 2/2] unhid all the buttons --- js/Clock.js | 2 +- js/main.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/js/Clock.js b/js/Clock.js index c38a7a7..70d3dc0 100644 --- a/js/Clock.js +++ b/js/Clock.js @@ -101,7 +101,7 @@ function Clock(sideLength) { }; this.rotate = function(steps) { - if (!(gameState === 1 || gameState === 0) && gameState !== -2) return; + if (!(gameState === 1 || gameState === 0)) return; this.position += steps; if (!history[count]) { history[count] = {}; diff --git a/js/main.js b/js/main.js index 0660be8..32ad353 100644 --- a/js/main.js +++ b/js/main.js @@ -179,6 +179,8 @@ function init(b) { op = 0; scoreOpacity = 0; gameState = 1; + $("#restartBtn").show(); + $("#pauseBtn").show(); if(saveState.clock !== undefined) gameState = 1; scaleCanvas();