|
|
|
@ -74,6 +74,7 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
c2.getBlockPosition(b2).y-c.getBlockPosition(b3).y: |
|
|
|
|
c.getBlockPosition(b3).y-c2.getBlockPosition(b2).y; |
|
|
|
|
c2.y+=(c2.getBlockPosition(b2).y>c.getBlockPosition(b3).y)? |
|
|
|
|
|
|
|
|
|
yDiff:-yDiff; |
|
|
|
|
float influence=(float)c.getBlocks().size()/(c.getBlocks().size()+c2.getBlocks().size()); |
|
|
|
|
int blockCount=c.getBlocks().size(); |
|
|
|
@ -120,7 +121,6 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
goto nextClump; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
c.y+=c.vspeed; |
|
|
|
|
nextClump:; |
|
|
|
|
} |
|
|
|
|
for (BlockClump&c:gameBoard.getBlockClumps()){ |
|
|
|
@ -357,6 +357,19 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
|
} |
|
|
|
|
gameBoard.addClump(c); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<gameBoard.getBlockClumps().size();i++){ //Resolve BlockClump movements.
|
|
|
|
|
BlockClump&c=gameBoard.getBlockClumps()[i]; |
|
|
|
|
if (c.vspeed<0) { |
|
|
|
|
for (int j=0;j<c.getBlocks().size();j++){ |
|
|
|
|
Block&b=c.getBlocks()[j]; |
|
|
|
|
if (c.getBlockPosition(b).y<0){ |
|
|
|
|
c.removeBlock(j--); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
c.y+=c.vspeed; |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<gameBoard.boardSize.x;i++){ |
|
|
|
|
for (int y=0;y<gameBoard.getBlocks(i).size();y++){ |
|
|
|
|
Block&b=gameBoard.getBlocks(i)[y]; |
|
|
|
|