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
+6 -5
View File
@@ -7,7 +7,7 @@
class MarioBlock : public SDLPP::RectangleRender {
public:
MarioBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer,
std::shared_ptr< SDLPP::Texture > texture, SDL_Rect src );
std::shared_ptr< SDLPP::Texture > texture, SDL_Rect src, bool destructible = false );
void visit( SDLPP::Visitor &visitor ) override;
void setTool( bool tool = true );
void setTerrain( bool terrain = true );
@@ -15,6 +15,7 @@ public:
private:
bool _tool = false;
bool _terrain = true;
bool _destructible = false;
};
extern const std::vector< uint64_t > possibleBlocks;
@@ -35,21 +36,21 @@ struct BlockRole {
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer,
bool collision = false );
bool collision = false, bool destructible = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer, int x, int y,
bool collision = false );
bool collision = false, bool destructible = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer,
std::shared_ptr< SDLPP::Texture > texture,
bool collision = false );
bool collision = false, bool destructible = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer, int x, int y,
std::shared_ptr< SDLPP::Texture > texture,
bool collision = false );
bool collision = false, bool destructible = false );
std::shared_ptr< SDLPP::RectangleRender >
createMario( LandType::Value type, std::shared_ptr< SDLPP::Renderer > &renderer,
int x, int y );