|
|
|
@ -194,32 +194,34 @@ bool Meteos::OnUserUpdate(float fElapsedTime) |
|
|
|
|
matchedBlocksX.push_back(&b); |
|
|
|
|
matchedBlocksY.push_back(&b); |
|
|
|
|
rightCheckGrounded: |
|
|
|
|
float checkX=targetX+12; |
|
|
|
|
float checkX=1; |
|
|
|
|
float checkY=targetY; |
|
|
|
|
do{ |
|
|
|
|
found=false; |
|
|
|
|
for (Block&b2:gameBoard.getBlocks(i)){ |
|
|
|
|
if (b.pos.x==b2.pos.x&&b.pos.y==b2.pos.y)continue; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (i+checkX<gameBoard.boardSize.x) { |
|
|
|
|
for (Block&b2:gameBoard.getBlocks(i+checkX)){ |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==b.pos.x+checkX*12&&b2.pos.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkX+=12; |
|
|
|
|
checkX++; |
|
|
|
|
matchedBlocksX.push_back(&b2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}while(found); |
|
|
|
|
leftCheckGrounded: |
|
|
|
|
checkX=targetX-12; |
|
|
|
|
checkX=-1; |
|
|
|
|
checkY=targetY; |
|
|
|
|
do{ |
|
|
|
|
found=false; |
|
|
|
|
for (Block&b2:gameBoard.getBlocks(i)){ |
|
|
|
|
if (b.pos.x==b2.pos.x&&b.pos.y==b2.pos.y)continue; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (i+checkX>=0) { |
|
|
|
|
for (Block&b2:gameBoard.getBlocks(i+checkX)){ |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==b.pos.x+checkX*12&&b2.pos.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkX-=12; |
|
|
|
|
checkX--; |
|
|
|
|
matchedBlocksX.push_back(&b2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}while(found); |
|
|
|
|
upCheckGrounded: |
|
|
|
|
checkX=targetX; |
|
|
|
|