no more -2 gameState
This commit is contained in:
parent
a247788fc2
commit
d8420a753e
3 changed files with 13 additions and 36 deletions
|
@ -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
|
||||
};
|
25
js/main.js
25
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();
|
||||
|
|
12
js/view.js
12
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) {
|
||||
|
|
Loading…
Reference in a new issue