removed for-in loops, fixed issue in which the text would fade/blur too fast
This commit is contained in:
parent
7ff7dec0d8
commit
4a95f2b7f0
2 changed files with 8 additions and 9 deletions
13
js/render.js
13
js/render.js
|
@ -13,30 +13,29 @@ 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--;
|
||||
}
|
||||
}
|
||||
|
||||
settings.prevScale = settings.scale;
|
||||
settings.hexWidth = settings.baseHexWidth * settings.scale;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue