Launching blocks now properly handled

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 20f77ffd02
commit da193146b7
  1. BIN
      C++ProjectTemplate
  2. 10
      main.cpp

Binary file not shown.

@ -70,12 +70,12 @@ void Meteos::updateGame(float fElapsedTime){
if (c2.getBlockPosition(b2).x==c.getBlockPosition(b3).x&& if (c2.getBlockPosition(b2).x==c.getBlockPosition(b3).x&&
c2.getBlockPosition(b2).y+12>=c.getBlockPosition(b3).y&& c2.getBlockPosition(b2).y+12>=c.getBlockPosition(b3).y&&
c2.getBlockPosition(b2).y<=c.getBlockPosition(b3).y+12) { c2.getBlockPosition(b2).y<=c.getBlockPosition(b3).y+12) {
float yDiff=(c2.getBlockPosition(b2).y>c.getBlockPosition(b3).y)?
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; if (c2.getBlockPosition(b2).y>c.getBlockPosition(b3).y) {
c.y-=12-(c2.getBlockPosition(b2).y-c.getBlockPosition(b3).y);
} else {
c2.y-=12-(c.getBlockPosition(b3).y-c2.getBlockPosition(b2).y);
}
float influence=(float)c.getBlocks().size()/(c.getBlocks().size()+c2.getBlocks().size()); float influence=(float)c.getBlocks().size()/(c.getBlocks().size()+c2.getBlocks().size());
int blockCount=c.getBlocks().size(); int blockCount=c.getBlocks().size();
//Copy every block from one clump to the other //Copy every block from one clump to the other

Loading…
Cancel
Save