daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest May 16th, 2018 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function deleteBlocks():void {
  2.     for (var i:uint = 0; i < blocks.length; i++) {
  3.         if (!blocks[i].needtobedeleted) {
  4.             if (blocks[i].colour != G.NULL) {
  5.                 var bU:Block = findBlock(blocks[i].x, blocks[i].y - 24);
  6.                 if (bU != null) {
  7.                     if (bU.colour == blocks[i].colour) {
  8.                         blocks[i].needtobedeleted = true;
  9.                         bU.needtobedeleted = true;
  10.                     }
  11.                 }
  12.                 var bR:Block = findBlock(blocks[i].x + 24, blocks[i].y);
  13.                 if (bR != null) {
  14.                     if (bR.colour == blocks[i].colour) {
  15.                         blocks[i].needtobedeleted = true;
  16.                         bR.needtobedeleted = true;
  17.                     }
  18.                 }
  19.                 var bD:Block = findBlock(blocks[i].x, blocks[i].y + 24);
  20.                 if (bD != null) {
  21.                     if (bD.colour == blocks[i].colour) {
  22.                         blocks[i].needtobedeleted = true;
  23.                         bD.needtobedeleted = true;
  24.                     }
  25.                 }
  26.                 var bL:Block = findBlock(blocks[i].x - 24, blocks[i].y);
  27.                 if (bL != null) {
  28.                     if (bL.colour == blocks[i].colour) {
  29.                         blocks[i].needtobedeleted = true;
  30.                         bL.needtobedeleted = true;
  31.                     }
  32.                 }
  33.             }
  34.         }
  35.     }
  36.     for (i = 0; i < blocks.length; i++) {
  37.         if (blocks[i].needtobedeleted) {
  38.             shards.push(["Block", new Point(blocks[i].x / 24, blocks[i].y / 24), blocks[i].colour, blocks[i].tilelock, blocks[i].ice, (uint(blocks[i].linkU)*10000+uint(blocks[i].linkR)*1000+uint(blocks[i].linkD)*100+uint(blocks[i].linkL)*10),blocks[i].forced]);
  39.             blocks[i] = null;
  40.         }
  41.     }
  42.     for (i = 0; i < blocks.length; i++) {
  43.         while (blocks[i] == null) blocks.splice(i,1);
  44.     }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top