diff --git a/tetris/config.cpp b/tetris/config.cpp index 4a1ee17..0350c3c 100644 --- a/tetris/config.cpp +++ b/tetris/config.cpp @@ -22,7 +22,7 @@ std::map> color_schemes = { {"barrier", "#AA0000"}, {"text", "#FFFFFF"}, {"text_out", "#000000"}, - {"menu_background", "#00000080"}, + {"menu_background", "#000000BB"}, {"menu_item_background", "#FFFFFF40"}, }}, { "gruvbox_dark", { @@ -46,7 +46,7 @@ std::map> color_schemes = { {"barrier", "#d65d0e"}, {"text", "#ebdbb2"}, {"text_out", "#1d2021"}, - {"menu_background", "#28282880"}, + {"menu_background", "#282828BB"}, {"menu_item_background", "#d5c4a180"}, }}, { "blackandwhite", { @@ -70,7 +70,7 @@ std::map> color_schemes = { {"barrier", "#FFFFFF"}, {"text", "#FFFFFF"}, {"text_out", "#000000"}, - {"menu_background", "#00000080"}, + {"menu_background", "#000000BB"}, {"menu_item_background", "#FFFFFF40"}, }}, }; diff --git a/tetris/functions.cpp b/tetris/functions.cpp index 1d881ff..c0988fa 100644 --- a/tetris/functions.cpp +++ b/tetris/functions.cpp @@ -45,6 +45,8 @@ void updateShadow(SDLPP::Scene &scene) { } void moveThem( std::shared_ptr< SDLPP::Scene > scene, int ticks ) { + if ( !g_cur_object ) + return; auto movement = g_cur_object->getMovement(); g_ticks_till_fall -= ticks; if ( g_cur_object->isDescending() ) diff --git a/tetris/scenes.cpp b/tetris/scenes.cpp index 274b940..fffb692 100644 --- a/tetris/scenes.cpp +++ b/tetris/scenes.cpp @@ -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 ); } } diff --git a/tetris/tetris.cpp b/tetris/tetris.cpp index 813b485..bf60e4b 100644 --- a/tetris/tetris.cpp +++ b/tetris/tetris.cpp @@ -23,7 +23,6 @@ void doInput() { while ( !g_quit ) { base = SDL_GetTicks(); SDL_framerateDelay( &gFPS ); - // TODO here comes the thingy g_input_functions.back()(g_main_scene, base, line_coliders); } }