diff --git a/js/Clock.js b/js/Clock.js index 49d7ee1..27dc3a0 100644 --- a/js/Clock.js +++ b/js/Clock.js @@ -103,7 +103,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/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 a84ab16..32ad353 100644 --- a/js/main.js +++ b/js/main.js @@ -178,7 +178,9 @@ function init(b) { spawnLane = 0; op = 0; scoreOpacity = 0; - gameState = -2; + gameState = 1; + $("#restartBtn").show(); + $("#pauseBtn").show(); if(saveState.clock !== undefined) gameState = 1; scaleCanvas(); @@ -280,21 +282,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 +328,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) {