Merge branch 'gh-pages' of https://github.com/teamsnowman/hextris into gh-pages
This commit is contained in:
commit
0eebf24cd7
4 changed files with 16 additions and 37 deletions
|
@ -103,7 +103,7 @@ function Clock(sideLength) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.rotate = function(steps) {
|
this.rotate = function(steps) {
|
||||||
if (!(gameState === 1 || gameState === 0) && gameState !== -2) return;
|
if (!(gameState === 1 || gameState === 0)) return;
|
||||||
this.position += steps;
|
this.position += steps;
|
||||||
if (!history[count]) {
|
if (!history[count]) {
|
||||||
history[count] = {};
|
history[count] = {};
|
||||||
|
|
|
@ -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
|
|
||||||
};
|
|
27
js/main.js
27
js/main.js
|
@ -178,7 +178,9 @@ function init(b) {
|
||||||
spawnLane = 0;
|
spawnLane = 0;
|
||||||
op = 0;
|
op = 0;
|
||||||
scoreOpacity = 0;
|
scoreOpacity = 0;
|
||||||
gameState = -2;
|
gameState = 1;
|
||||||
|
$("#restartBtn").show();
|
||||||
|
$("#pauseBtn").show();
|
||||||
if(saveState.clock !== undefined) gameState = 1;
|
if(saveState.clock !== undefined) gameState = 1;
|
||||||
|
|
||||||
scaleCanvas();
|
scaleCanvas();
|
||||||
|
@ -280,21 +282,6 @@ function exportHistory() {
|
||||||
toggleDevTools();
|
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() {
|
function setStartScreen() {
|
||||||
$('#startBtn').show();
|
$('#startBtn').show();
|
||||||
if (!isStateSaved()) {
|
if (!isStateSaved()) {
|
||||||
|
@ -341,14 +328,6 @@ function animLoop() {
|
||||||
render();
|
render();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -2:
|
|
||||||
requestAnimFrame(animLoop);
|
|
||||||
settings.hexWidth = settings.baseHexWidth * settings.scale;
|
|
||||||
settings.blockHeight = settings.baseBlockHeight * settings.scale;
|
|
||||||
stepInitialLoad();
|
|
||||||
render();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
requestAnimFrame(animLoop);
|
requestAnimFrame(animLoop);
|
||||||
render();
|
render();
|
||||||
|
|
12
js/view.js
12
js/view.js
|
@ -25,6 +25,18 @@ var rgbColorsToTintedColors = {
|
||||||
var hexagonBackgroundColor = 'rgb(236, 240, 241)';
|
var hexagonBackgroundColor = 'rgb(236, 240, 241)';
|
||||||
var hexagonBackgroundColorClear = 'rgba(236, 240, 241, 0.5)';
|
var hexagonBackgroundColorClear = 'rgba(236, 240, 241, 0.5)';
|
||||||
var centerBlue = 'rgb(44,62,80)'; //tumblr?
|
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) {
|
function renderText(x, y, fontSize, color, text, font) {
|
||||||
if (!font) {
|
if (!font) {
|
||||||
|
|
Loading…
Reference in a new issue