Mario: destructible blocks

This commit is contained in:
2021-05-24 00:07:40 +02:00
parent bea479bf72
commit b75b44201a
4 changed files with 28 additions and 19 deletions
+4 -1
View File
@@ -41,13 +41,16 @@ void loadMap( std::shared_ptr< SDLPP::Scene > &scene,
}
}
bool collision = false;
bool destructible = false;
if ( id == FLOOR_ID || id == BRICK_ID || id == BRICK_TOP_ID ) {
collision = true;
if(id != FLOOR_ID)
destructible = true;
}
// TODO add modifiers to createTerrainBlock
auto obj =
createTerrainBlock( id, static_cast< LandType::Value >( type ),
renderer, i, j, collision );
renderer, i, j, collision, destructible );
if ( obj != nullptr )
scene->addObject( obj );
if ( character ) {