Trying to switch to more object-oriented

This commit is contained in:
2021-03-12 22:33:46 +01:00
parent fbe122a5b9
commit 258ce51cfe
32 changed files with 693 additions and 249 deletions
+3 -3
View File
@@ -457,11 +457,11 @@ void mainSceneInput(
for ( auto &col : collisions ) {
col->destroy();
}
auto colider_y = colider->getPos().second;
auto colider_y = colider->getPos().getY();
for ( auto &elem : scene->getObjects( { BRICK_ID } ) ) {
auto pos = elem->getPos();
if ( pos.second < colider_y && pos.first <= RIGHT_BORDER ) {
elem->setPos( pos.first, pos.second + BLOCK_SIZE );
if ( pos.getY() < colider_y && pos.getX() <= RIGHT_BORDER ) {
elem->setPos( pos.getX(), pos.getY() + BLOCK_SIZE );
}
}
using namespace std::chrono_literals;