TETRIS: change menu background, slightly alter checking for full lines

This commit is contained in:
2020-09-11 21:54:45 +02:00
parent bd60a8bf59
commit 0a06e1d841
4 changed files with 7 additions and 8 deletions
+2 -4
View File
@@ -404,11 +404,9 @@ void mainSceneInput( std::shared_ptr< SDLPP::Scene > scene, int base, std::vecto
col->destroy();
}
auto colider_y = colider->getPos().second;
for ( auto &elem : scene->getObjects() ) {
if ( elem->getId() != BRICK_ID )
continue;
for ( auto &elem : scene->getObjects({BRICK_ID}) ) {
auto pos = elem->getPos();
if ( pos.second < colider_y && pos.first >= LEFT_BORDER && pos.first <= RIGHT_BORDER ) {
if ( pos.second < colider_y && pos.first <= RIGHT_BORDER ) {
elem->setPos( pos.first, pos.second + BLOCK_SIZE );
}
}