diff --git a/checking.js b/checking.js index 722c65f..f06606d 100644 --- a/checking.js +++ b/checking.js @@ -66,7 +66,7 @@ function consolidateBlocks(clock,side,index) { deleted.push([]); } eraseBlocks(clock,deleted); - return + return; } function eraseBlocks(clock,deleted) { diff --git a/entities.js b/entities.js index 4aa6562..0e5c762 100644 --- a/entities.js +++ b/entities.js @@ -88,22 +88,34 @@ function Clock(sideLength) { if (position <= 0) { if (block.distFromHex - (this.sideLength/2) * Math.sqrt(3) <= 0) { block.settled = 1; + if (iter == 2 && block.distFromHex + 1 - (this.sideLength/2) * Math.sqrt(3) <= 0) { + block.distFromHex--; + } } } else { if (block.distFromHex + iter - arr[position - 1].distFromHex - arr[position - 1].height <= 0) { block.settled = 1; + if (iter == 2 && block.distFromHex + 1 + iter - arr[position - 1].distFromHex - arr[position - 1].height <= 0) { + block.distFromHex--; + } } } } else { if (arr.length > 0) { if (block.distFromHex + iter - arr[arr.length - 1].distFromHex - arr[arr.length - 1].height <= 0) { + if (iter == 2 && block.distFromHex + iter + 1 - arr[arr.length - 1].distFromHex - arr[arr.length - 1].height <= 0) { + block.distFromHex--; + } this.addBlock(block); } } else { if (block.distFromHex + iter - (this.sideLength/2) * Math.sqrt(3) <= 0) { + if (iter == 2 && block.distFromHex + iter + 1 - (this.sideLength/2) * Math.sqrt(3) <= 0) { + block.distFromHex--; + } this.addBlock(block); } } diff --git a/index.html b/index.html index dcceef0..b581af0 100644 --- a/index.html +++ b/index.html @@ -17,11 +17,11 @@
-