Merge branch 'gh-pages' of http://github.com/teamsnowman/hextris into gh-pages
This commit is contained in:
commit
ee27fb8a73
4 changed files with 13 additions and 12 deletions
|
@ -127,9 +127,10 @@ function Clock(sideLength) {
|
|||
};
|
||||
|
||||
this.draw = function() {
|
||||
this.ct++;
|
||||
this.ct++;
|
||||
this.x = trueCanvas.width/2;
|
||||
if (gameState == 1) {
|
||||
|
||||
if (gameState != -2) {
|
||||
this.y = trueCanvas.height/2;
|
||||
}
|
||||
this.sideLength = settings.hexWidth;
|
||||
|
|
12
js/render.js
12
js/render.js
|
@ -13,28 +13,28 @@ function render() {
|
|||
drawPolygon(trueCanvas.width / 2 , trueCanvas.height / 2 , 6, (settings.rows * settings.blockHeight) * (2/Math.sqrt(3)) + settings.hexWidth, 30, grey, false,6);
|
||||
ctx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
for (var i in MainClock.blocks) {
|
||||
var i;
|
||||
for (i = 0; i < MainClock.blocks.length; i++) {
|
||||
for (var j = 0; j < MainClock.blocks[i].length; j++) {
|
||||
var block = MainClock.blocks[i][j];
|
||||
block.draw(true, j);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in blocks) {
|
||||
for (i = 0; i < blocks.length; i++) {
|
||||
blocks[i].draw();
|
||||
}
|
||||
|
||||
|
||||
MainClock.draw();
|
||||
if ( gameState ==1 | gameState ==-1 ) {
|
||||
drawScoreboard();
|
||||
}
|
||||
for (var i in MainClock.texts) {
|
||||
for (i = 0; i < MainClock.texts.length; i++) {
|
||||
var alive = MainClock.texts[i].draw();
|
||||
if(!alive){
|
||||
MainClock.texts.splice(i,1)
|
||||
MainClock.texts.splice(i,1);
|
||||
}
|
||||
|
||||
i--;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ function renderText(x, y, fontSize, color, text) {
|
|||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = color;
|
||||
ctx.fillText(text, x, y + (fontSize / 2) - 9 * settings.scale);
|
||||
|
||||
}
|
||||
|
||||
scoreOpacity = 0;
|
||||
function drawScoreboard() {
|
||||
if(scoreOpacity < 1){
|
||||
|
|
|
@ -15,12 +15,12 @@ function blockDestroyed() {
|
|||
function waveGen(clock) {
|
||||
this.lastGen = 0;
|
||||
this.last = 0;
|
||||
this.nextGen = 1650; // - 1500; //delay before starting
|
||||
this.nextGen = 2000; // - 1500; //delay before starting
|
||||
this.start = 0;
|
||||
this.colors = colors;
|
||||
this.ct = 0;
|
||||
this.clock = clock;
|
||||
this.difficulty = 0;
|
||||
this.difficulty = 1;
|
||||
this.dt = 0;
|
||||
this.update = function() {
|
||||
this.currentFunction();
|
||||
|
@ -28,7 +28,7 @@ function waveGen(clock) {
|
|||
this.computeDifficulty();
|
||||
if (this.dt - this.lastGen * (1/settings.creationSpeedModifier) > this.nextGen) {
|
||||
if (this.nextGen > 1000) {
|
||||
this.nextGen -= (.7 * (this.nextGen/1300)) * settings.creationSpeedModifier;
|
||||
this.nextGen -= (0.7 * (this.nextGen/1300)) * settings.creationSpeedModifier;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue