diff --git a/Meteo_Engine.jar b/Meteo_Engine.jar index a6f7035..1c280b0 100644 Binary files a/Meteo_Engine.jar and b/Meteo_Engine.jar differ diff --git a/src/sig/Board.java b/src/sig/Board.java index 02adb06..5d037ef 100644 --- a/src/sig/Board.java +++ b/src/sig/Board.java @@ -103,11 +103,17 @@ public class Board { for (int[] range : blocks.collisionColumnRanges) { if (range[1]*block_height+blocks.y>block_height*height) { List removedBlocks = blocks.getBlocks().stream().filter((block)->block.y*block_height+blocks.y>block_height*height).collect(Collectors.toList()); - blocks.removeBlock(removedBlocks.toArray(new Block[removedBlocks.size()])); + RemoveBlocks(blocks,removedBlocks.toArray(new Block[removedBlocks.size()])); } } } } + private void RemoveBlocks(BlockClump bc,Block...blocks) { + bc.removeBlock(blocks); + if (bc.getBlocks().size()==0) { + blockClumpDeleteList.add(bc); + } + } private void MergeAllGroundedClumps() { List groundedClumps = blockData.stream().filter((cl)->cl.y==0).collect(Collectors.toList()); if (groundedClumps.size()>1) { @@ -144,7 +150,7 @@ public class Board { minY=Math.min(minY,b.y); } //For now just get rid of them. - blocks.removeBlock(newClumpBlocks.toArray(new Block[newClumpBlocks.size()])); + RemoveBlocks(blocks,newClumpBlocks.toArray(new Block[newClumpBlocks.size()])); for (Block b : newClumpBlocks) { b.y-=minY; }