scaled difficulty, fixed issuei n which blocks don't fall after blocks below them are destroyed
This commit is contained in:
parent
318502372a
commit
c57d15e6d3
2 changed files with 18 additions and 20 deletions
20
js/update.js
20
js/update.js
|
@ -22,13 +22,13 @@ function update() {
|
|||
waveone.prevTimeScored = now;
|
||||
}
|
||||
}
|
||||
var lowestDeletedIndex;
|
||||
var lowestDeletedIndex = 99;
|
||||
var i;
|
||||
var j;
|
||||
var block;
|
||||
|
||||
var objectsToRemove = [];
|
||||
for (i in blocks) {
|
||||
for (i = 0; i < blocks.length; i++) {
|
||||
MainClock.doesBlockCollide(blocks[i]);
|
||||
if (!blocks[i].settled) {
|
||||
if (!blocks[i].initializing) blocks[i].distFromHex -= blocks[i].iter * settings.scale;
|
||||
|
@ -39,12 +39,12 @@ function update() {
|
|||
|
||||
for (i = 0; i < MainClock.blocks.length; i++) {
|
||||
for (j = 0; j < MainClock.blocks[i].length; j++) {
|
||||
if(MainClock.blocks[i][j].checked ==1 ){
|
||||
consolidateBlocks(MainClock,MainClock.blocks[i][j].attachedLane,MainClock.blocks[i][j].getIndex());
|
||||
MainClock.blocks[i][j].checked=0;
|
||||
}
|
||||
}
|
||||
if (MainClock.blocks[i][j].checked ==1 ) {
|
||||
consolidateBlocks(MainClock,MainClock.blocks[i][j].attachedLane,MainClock.blocks[i][j].getIndex());
|
||||
MainClock.blocks[i][j].checked=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MainClock.blocks.length; i++) {
|
||||
lowestDeletedIndex = 99;
|
||||
|
@ -59,13 +59,13 @@ function update() {
|
|||
}
|
||||
|
||||
if (lowestDeletedIndex < MainClock.blocks[i].length) {
|
||||
for (j = lowestDeletedIndex; q < MainClock.blocks[i].length; q++) {
|
||||
MainClock.blocks[i][q].settled = 0;
|
||||
for (j = lowestDeletedIndex; j < MainClock.blocks[i].length; j++) {
|
||||
MainClock.blocks[i][j].settled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i in MainClock.blocks) {
|
||||
for (i = 0; i < MainClock.blocks.length; i++) {
|
||||
for (j = 0; j < MainClock.blocks[i].length; j++) {
|
||||
block = MainClock.blocks[i][j];
|
||||
MainClock.doesBlockCollide(block, j, MainClock.blocks[i]);
|
||||
|
|
|
@ -21,7 +21,6 @@ function waveGen(clock) {
|
|||
this.ct = 0;
|
||||
this.clock = clock;
|
||||
this.difficulty = 0;
|
||||
this.integerDifficulty = this.difficulty;
|
||||
this.dt = 0;
|
||||
this.update = function() {
|
||||
this.currentFunction();
|
||||
|
@ -39,7 +38,7 @@ function waveGen(clock) {
|
|||
this.ct++;
|
||||
this.lastGen = this.dt;
|
||||
var fv = randInt(0, MainClock.sides);
|
||||
addNewBlock(fv, colors[randInt(0, colors.length)], 1.3 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock(fv, colors[randInt(0, colors.length)], 1.6 + (this.difficulty/15) * 3);
|
||||
if (this.ct > 7) {
|
||||
var nextPattern = randInt(0, 20 + 4);
|
||||
if (nextPattern > 4 + 17) {
|
||||
|
@ -70,7 +69,6 @@ function waveGen(clock) {
|
|||
this.difficulty += (this.dt - this.last)/(40000000);
|
||||
}
|
||||
}
|
||||
this.integerDifficulty = Math.floor(this.difficulty);
|
||||
};
|
||||
|
||||
this.circleGeneration = function() {
|
||||
|
@ -94,7 +92,7 @@ function waveGen(clock) {
|
|||
}
|
||||
|
||||
for (var i = 0; i < MainClock.sides; i++) {
|
||||
addNewBlock(i, colorList[i % numColors], 1.5 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock(i, colorList[i % numColors], 1.5 + (this.difficulty/15) * 3);
|
||||
}
|
||||
|
||||
this.ct += 15;
|
||||
|
@ -107,8 +105,8 @@ function waveGen(clock) {
|
|||
if (this.dt - this.lastGen > this.nextGen) {
|
||||
var ri = randInt(0, colors.length);
|
||||
var i = randInt(0, colors.length);
|
||||
addNewBlock(i, colors[ri], 0.6 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock((i + 3) % MainClock.sides, colors[ri], 0.6 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock(i, colors[ri], 0.6 + (this.difficulty/15) * 3);
|
||||
addNewBlock((i + 3) % MainClock.sides, colors[ri], 0.6 + (this.difficulty/15) * 3);
|
||||
this.ct += 1.5;
|
||||
this.lastGen = this.dt;
|
||||
this.shouldChangePattern();
|
||||
|
@ -119,10 +117,10 @@ function waveGen(clock) {
|
|||
var dir = randInt(0, 2);
|
||||
if (this.dt - this.lastGen > this.nextGen * (5/9)) {
|
||||
if (dir) {
|
||||
addNewBlock(5 - (this.ct % MainClock.sides), colors[randInt(0, colors.length)], 1.5 + (this.integerDifficulty/15) * (3/2));
|
||||
addNewBlock(5 - (this.ct % MainClock.sides), colors[randInt(0, colors.length)], 1.5 + (this.difficulty/15) * (3/2));
|
||||
}
|
||||
else {
|
||||
addNewBlock(this.ct % MainClock.sides, colors[randInt(0, colors.length)], 1.5 + (this.integerDifficulty/15) * (3/2));
|
||||
addNewBlock(this.ct % MainClock.sides, colors[randInt(0, colors.length)], 1.5 + (this.difficulty/15) * (3/2));
|
||||
}
|
||||
this.ct += 1;
|
||||
this.lastGen = this.dt;
|
||||
|
@ -133,8 +131,8 @@ function waveGen(clock) {
|
|||
this.doubleGeneration = function() {
|
||||
if (this.dt - this.lastGen > this.nextGen) {
|
||||
var i = randInt(0, colors.length);
|
||||
addNewBlock(i, colors[randInt(0, colors.length)], 1.5 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock((i + 1) % MainClock.sides, colors[randInt(0, colors.length)], 1.5 + (this.integerDifficulty/15) * 3);
|
||||
addNewBlock(i, colors[randInt(0, colors.length)], 1.5 + (this.difficulty/15) * 3);
|
||||
addNewBlock((i + 1) % MainClock.sides, colors[randInt(0, colors.length)], 1.5 + (this.difficulty/15) * 3);
|
||||
this.ct += 2;
|
||||
this.lastGen = this.dt;
|
||||
this.shouldChangePattern();
|
||||
|
|
Loading…
Reference in a new issue