|
|
|
@ -121,7 +121,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
lastBlockSpawn+=fElapsedTime; |
|
|
|
|
if (lastBlockSpawn>=gameBoard.spawnRate){ |
|
|
|
|
lastBlockSpawn-=gameBoard.spawnRate; |
|
|
|
|
//gameBoard.spawnBlock(randBlockPos(gen));
|
|
|
|
|
gameBoard.spawnBlock(randBlockPos(gen)); |
|
|
|
|
} |
|
|
|
|
for (int i=gameBoard.getBlockClumps().size()-1;i>=0;i--){ |
|
|
|
|
BlockClump&c=gameBoard.getBlockClumps()[i]; |
|
|
|
@ -288,7 +288,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
found=true; |
|
|
|
|
checkX+=12; |
|
|
|
|
tempMatchIDsX.push_back({(int)b.pos.x/12,j,g}); |
|
|
|
|
break; |
|
|
|
|
goto outerRightCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (c.landTime>0){ |
|
|
|
@ -298,7 +298,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
if (c2.landTime>0){ |
|
|
|
|
for (int j=0;j<c2.getBlocks().size();j++){ |
|
|
|
|
Block&b2=c2.getBlocks()[j]; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y-c.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkX+=12; |
|
|
|
|
tempMatchIDsX.push_back({(int)b2.pos.x/12,j,h}); |
|
|
|
@ -322,7 +322,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
found=true; |
|
|
|
|
checkX-=12; |
|
|
|
|
tempMatchIDsX.push_back({(int)b.pos.x/12,j,g}); |
|
|
|
|
break; |
|
|
|
|
goto outerLeftCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (c.landTime>0){ |
|
|
|
@ -332,16 +332,17 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
if (c2.landTime>0){ |
|
|
|
|
for (int j=0;j<c2.getBlocks().size();j++){ |
|
|
|
|
Block&b2=c2.getBlocks()[j]; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y-c.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkX-=12; |
|
|
|
|
tempMatchIDsX.push_back({(int)b2.pos.x/12,j,h}); |
|
|
|
|
goto outerRightCheck; |
|
|
|
|
goto outerLeftCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
outerLeftCheck:; |
|
|
|
|
}while(found); |
|
|
|
|
upCheck: |
|
|
|
|
checkX=targetX; |
|
|
|
@ -355,7 +356,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
found=true; |
|
|
|
|
checkY-=12; |
|
|
|
|
tempMatchIDsY.push_back({(int)b.pos.x/12,j,g}); |
|
|
|
|
break; |
|
|
|
|
goto outerUpCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (c.landTime>0){ |
|
|
|
@ -365,16 +366,17 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
if (c2.landTime>0){ |
|
|
|
|
for (int j=0;j<c2.getBlocks().size();j++){ |
|
|
|
|
Block&b2=c2.getBlocks()[j]; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y-c.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkY-=12; |
|
|
|
|
tempMatchIDsY.push_back({(int)b2.pos.x/12,j,h}); |
|
|
|
|
goto outerRightCheck; |
|
|
|
|
goto outerUpCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
outerUpCheck:; |
|
|
|
|
}while(found); |
|
|
|
|
downCheck: |
|
|
|
|
checkX=targetX; |
|
|
|
@ -388,7 +390,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
found=true; |
|
|
|
|
checkY+=12; |
|
|
|
|
tempMatchIDsY.push_back({(int)b.pos.x/12,j,g}); |
|
|
|
|
break; |
|
|
|
|
goto outerDownCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (c.landTime>0){ |
|
|
|
@ -398,16 +400,17 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
if (c2.landTime>0){ |
|
|
|
|
for (int j=0;j<c2.getBlocks().size();j++){ |
|
|
|
|
Block&b2=c2.getBlocks()[j]; |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y==checkY) { |
|
|
|
|
if (b.col==b2.col&&b2.col!=BlockColor::LAUNCHED&&b2.pos.x==checkX&&b2.pos.y-c.y==checkY) { |
|
|
|
|
found=true; |
|
|
|
|
checkY+=12; |
|
|
|
|
tempMatchIDsY.push_back({(int)b2.pos.x/12,j,h}); |
|
|
|
|
goto outerRightCheck; |
|
|
|
|
goto outerDownCheck; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
outerDownCheck:; |
|
|
|
|
}while(found); |
|
|
|
|
if (tempMatchIDsX.size()>2||tempMatchIDsY.size()>2) { |
|
|
|
|
if (tempMatchIDsX.size()>2) { |
|
|
|
|