Merge branch 'gh-pages' of https://github.com/teamsnowman/hextris into gh-pages

This commit is contained in:
meadowstream 2014-07-01 22:30:13 -04:00
commit 0eebf24cd7
4 changed files with 16 additions and 37 deletions

View file

@ -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] = {};

View file

@ -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
};

View file

@ -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();

View file

@ -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) {