diff --git a/BlockClump.cpp b/BlockClump.cpp index 51ea06d..b692e52 100644 --- a/BlockClump.cpp +++ b/BlockClump.cpp @@ -34,4 +34,8 @@ void BlockClump::sortBlocks(){ std::sort(blocks.begin(),blocks.end(),[](Block&b1,Block&b2){ return b1.pos.y>b2.pos.y; }); +} + +void BlockClump::removeBlock(int i){ + blocks.erase(blocks.begin()+i); } \ No newline at end of file diff --git a/BlockClump.h b/BlockClump.h index cff0c53..fccd233 100644 --- a/BlockClump.h +++ b/BlockClump.h @@ -21,5 +21,6 @@ class BlockClump{ //Get a block's position relative to this block clump. vf2d getBlockPosition(Block&b); void sortBlocks(); + void removeBlock(int i); }; #endif \ No newline at end of file diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 8762146..46032c0 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index b9f21e1..5ba8a49 100644 --- a/main.cpp +++ b/main.cpp @@ -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