Launching works proper

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent c4df26a5a3
commit c7eec514b5
  1. BIN
      C++ProjectTemplate
  2. 17
      main.cpp

Binary file not shown.

@ -260,6 +260,14 @@ bool Meteos::OnUserUpdate(float fElapsedTime)
c.addBlockOnTopOf(b2->pos.x/12,b2->col);
b2->markedForRemoval=true;
}
for (Block*b2:matchedBlocksX) {
for (Block&b3:gameBoard.getBlocks(b2->pos.x/12)) {
if (!b3.markedForRemoval&&b3.pos.y<b2->pos.y) {
c.addBlockOnTopOf(b2->pos.x/12,b3.col);
b3.markedForRemoval=true;
}
}
}
c.vspeed=gameBoard.launchSpd;
}
if (matchedBlocksY.size()>2) {
@ -269,6 +277,15 @@ bool Meteos::OnUserUpdate(float fElapsedTime)
c.addBlockOnTopOf(b2->pos.x/12,b2->col);
b2->markedForRemoval=true;
}
for (int i=0;i<matchedBlocksY.size();i++) {
Block*b2=matchedBlocksY[i];
for (Block&b3:gameBoard.getBlocks(b2->pos.x/12)) {
if (!b3.markedForRemoval&&b3.pos.y<b2->pos.y) {
c.addBlockOnTopOf(b2->pos.x/12,b3.col);
b3.markedForRemoval=true;
}
}
}
c.vspeed=gameBoard.launchSpd;
}
gameBoard.addClump(c);

Loading…
Cancel
Save