Refactor to use objects for terrain/mod creation, added coin modifier
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
#include "coinblock.hpp"
|
||||
#include "../objectids.hpp"
|
||||
|
||||
CoinEditorBlock::CoinEditorBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer ) :
|
||||
MarioBlock( x, y, renderer, g_translucent_mod_texture, MOD_COIN_SRC, false, false ) {
|
||||
setId(COIN_MODIFIER_ID);
|
||||
auto mypos = getDoubleRect();
|
||||
auto size = mypos.second.getX() / 1.5;
|
||||
_amount_text = std::make_shared<SDLPP::TextRenderer>( mypos.first.getX() + mypos.second.getX() - size, mypos.first.getY() + mypos.second.getX() - size, size, size, renderer, "1", g_text_config );
|
||||
setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
|
||||
_amount_text->setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
|
||||
}
|
||||
|
||||
void CoinEditorBlock::render() {
|
||||
MarioBlock::render();
|
||||
if ( _amount_text != NULL ) {
|
||||
_amount_text->render();
|
||||
}
|
||||
}
|
||||
|
||||
void CoinEditorBlock::updateSizeAndPosition() {
|
||||
MarioBlock::updateSizeAndPosition();
|
||||
auto block_size = getDoubleRect().second;
|
||||
_amount_text->setPos( getPos() + block_size - block_size / 1.5 );
|
||||
_amount_text->updateSizeAndPosition();
|
||||
}
|
||||
|
||||
void CoinEditorBlock::addOne() {
|
||||
if(_amount < 15) {
|
||||
_amount++;
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
void CoinEditorBlock::subtractOne() {
|
||||
if(_amount > 1) {
|
||||
_amount--;
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
void CoinEditorBlock::setAmount(int amount) {
|
||||
if(amount < 1) {
|
||||
amount = 1;
|
||||
} else if(amount > 15) {
|
||||
amount = 15;
|
||||
}
|
||||
_amount = amount;
|
||||
updateText();
|
||||
}
|
||||
|
||||
void CoinEditorBlock::updateText() {
|
||||
_amount_text->changeText(std::to_string(_amount));
|
||||
}
|
||||
|
||||
void CoinEditorBlock::onScrollUp() {
|
||||
addOne();
|
||||
}
|
||||
|
||||
void CoinEditorBlock::onScrollDown() {
|
||||
subtractOne();
|
||||
}
|
||||
|
||||
uint8_t CoinEditorBlock::getData() {
|
||||
return _amount;
|
||||
}
|
||||
|
||||
void CoinEditorBlock::setData(uint8_t data) {
|
||||
setAmount(data);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef COIN_BLOCK_H
|
||||
#define COIN_BLOCK_H
|
||||
|
||||
#include "../blocks.hpp"
|
||||
#include "../global_vars.hpp"
|
||||
#include "../sprites.hpp"
|
||||
#include "../../sdlpp/sdlpp_textrenderer.hpp"
|
||||
|
||||
class CoinEditorBlock : public MarioBlock {
|
||||
public:
|
||||
CoinEditorBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
virtual void render() override;
|
||||
virtual void updateSizeAndPosition() override;
|
||||
void addOne();
|
||||
void subtractOne();
|
||||
void setAmount(int amount);
|
||||
virtual void onScrollUp() override;
|
||||
virtual void onScrollDown() override;
|
||||
virtual uint8_t getData() override;
|
||||
virtual void setData(uint8_t data) override;
|
||||
private:
|
||||
void updateText();
|
||||
int _amount = 1;
|
||||
std::shared_ptr<SDLPP::TextRenderer> _amount_text;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,454 @@
|
||||
#include "simpleblocks.hpp"
|
||||
#include "../global_vars.hpp"
|
||||
#include "../sprites.hpp"
|
||||
#include "../objectids.hpp"
|
||||
|
||||
FloorBlock::FloorBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, FLOOR_SRC, true ) {
|
||||
ensureCollision();
|
||||
setId( FLOOR_ID );
|
||||
}
|
||||
|
||||
HillInclineBlock::HillInclineBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_INCLINE_SRC,
|
||||
false ) {
|
||||
setId( HILL_INCLINE_ID );
|
||||
}
|
||||
|
||||
HillDeclineBlock::HillDeclineBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_DECLINE_SRC,
|
||||
false ) {
|
||||
setId( HILL_INCLINE_ID );
|
||||
}
|
||||
|
||||
HillDotsRightBlock::HillDotsRightBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_DOTS_RIGHT_SRC,
|
||||
false ) {
|
||||
setId( HILL_DOTS_RIGHT_ID );
|
||||
}
|
||||
|
||||
HillDotsLeftBlock::HillDotsLeftBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_DOTS_LEFT_SRC,
|
||||
false ) {
|
||||
setId( HILL_DOTS_LEFT_ID );
|
||||
}
|
||||
|
||||
HillFillBlock::HillFillBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_FILL_SRC,
|
||||
false ) {
|
||||
setId( HILL_FILL_ID );
|
||||
}
|
||||
|
||||
HillTopBlock::HillTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, HILL_TOP_SRC, false ) {
|
||||
setId( HILL_TOP_ID );
|
||||
}
|
||||
|
||||
BushLeftBlock::BushLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, BUSH_LEFT_SRC,
|
||||
false ) {
|
||||
setId( BUSH_LEFT_ID );
|
||||
}
|
||||
|
||||
BushMiddleBlock::BushMiddleBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, BUSH_MIDDLE_SRC,
|
||||
false ) {
|
||||
setId( BUSH_MIDDLE_ID );
|
||||
}
|
||||
|
||||
BushRightBlock::BushRightBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, BUSH_RIGHT_SRC,
|
||||
false ) {
|
||||
setId( BUSH_RIGHT_ID );
|
||||
}
|
||||
|
||||
CloudLeftBottomBlock::CloudLeftBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CLOUD_LEFT_BOTTOM_SRC,
|
||||
false ) {
|
||||
setId( CLOUD_LEFT_BOTTOM_ID );
|
||||
}
|
||||
|
||||
CloudMiddleBottomBlock::CloudMiddleBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
CLOUD_MIDDLE_BOTTOM_SRC, false ) {
|
||||
setId( CLOUD_MIDDLE_BOTTOM_ID );
|
||||
}
|
||||
|
||||
CloudRightBottomBlock::CloudRightBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CLOUD_RIGHT_BOTTOM_SRC,
|
||||
false ) {
|
||||
setId( CLOUD_RIGHT_BOTTOM_ID );
|
||||
}
|
||||
|
||||
CloudLeftTopBlock::CloudLeftTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CLOUD_LEFT_TOP_SRC,
|
||||
false ) {
|
||||
setId( CLOUD_LEFT_TOP_ID );
|
||||
}
|
||||
|
||||
CloudMiddleTopBlock::CloudMiddleTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CLOUD_MIDDLE_TOP_SRC,
|
||||
false ) {
|
||||
setId( CLOUD_MIDDLE_TOP_ID );
|
||||
}
|
||||
|
||||
CloudRightTopBlock::CloudRightTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CLOUD_RIGHT_TOP_SRC,
|
||||
false ) {
|
||||
setId( CLOUD_RIGHT_TOP_ID );
|
||||
}
|
||||
|
||||
PipeLeftBottomBlock::PipeLeftBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, PIPE_LEFT_BOTTOM_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( PIPE_LEFT_BOTTOM_ID );
|
||||
}
|
||||
|
||||
PipeRightBottomBlock::PipeRightBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, PIPE_RIGHT_BOTTOM_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( PIPE_RIGHT_BOTTOM_ID );
|
||||
}
|
||||
|
||||
PipeLeftTopBlock::PipeLeftTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, PIPE_LEFT_TOP_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( PIPE_LEFT_TOP_ID );
|
||||
}
|
||||
|
||||
PipeRightTopBlock::PipeRightTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, PIPE_RIGHT_TOP_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( PIPE_RIGHT_TOP_ID );
|
||||
}
|
||||
|
||||
CastleLeftBlock::CastleLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CASTLE_LEFT_SRC,
|
||||
false ) {
|
||||
setId( CASTLE_LEFT_ID );
|
||||
}
|
||||
|
||||
CastleRightBlock::CastleRightBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CASTLE_RIGHT_SRC,
|
||||
false ) {
|
||||
setId( CASTLE_RIGHT_ID );
|
||||
}
|
||||
|
||||
CastleBlackBlock::CastleBlackBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CASTLE_BLACK_SRC,
|
||||
false ) {
|
||||
setId( CASTLE_BLACK_ID );
|
||||
}
|
||||
|
||||
CastleEntryBlock::CastleEntryBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CASTLE_ENTRY_SRC,
|
||||
false ) {
|
||||
setId( CASTLE_ENTRY_ID );
|
||||
}
|
||||
|
||||
CastleTowerBlock::CastleTowerBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CASTLE_TOWER_SRC,
|
||||
false ) {
|
||||
setId( CASTLE_TOWER_ID );
|
||||
}
|
||||
|
||||
CastleTowerFilledBlock::CastleTowerFilledBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
CASTLE_TOWER_FILLED_SRC, false ) {
|
||||
setId( CASTLE_TOWER_FILLED_ID );
|
||||
}
|
||||
|
||||
VineTopBlock::VineTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, VINE_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( VINE_TOP_ID );
|
||||
}
|
||||
|
||||
VineBottomBlock::VineBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, VINE_BOTTOM_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( VINE_BOTTOM_ID );
|
||||
}
|
||||
|
||||
PoleTopBlock::PoleTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, POLE_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( POLE_TOP_ID );
|
||||
}
|
||||
|
||||
PoleBottomBlock::PoleBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, POLE_BOTTOM_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( POLE_BOTTOM_ID );
|
||||
}
|
||||
|
||||
FlagBlock::FlagBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, FLAG_SRC, false ) {
|
||||
setId( FLAG_ID );
|
||||
}
|
||||
|
||||
StepBlock::StepBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, STEP_SRC, true ) {
|
||||
ensureCollision();
|
||||
setId( STEP_ID );
|
||||
}
|
||||
|
||||
BrickBlock::BrickBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, BRICK_SRC, true ) {
|
||||
ensureCollision();
|
||||
setId( BRICK_ID );
|
||||
}
|
||||
|
||||
BrickTopBlock::BrickTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, BRICK_TOP_SRC, true ) {
|
||||
ensureCollision();
|
||||
setId( BRICK_TOP_ID );
|
||||
}
|
||||
|
||||
SidewayPipeEndTopBlock::SidewayPipeEndTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_END_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_END_TOP_ID );
|
||||
}
|
||||
|
||||
SidewayPipeEndBottomBlock::SidewayPipeEndBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_END_BOTTOM_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_END_BOTTOM_ID );
|
||||
}
|
||||
|
||||
SidewayPipeMiddleTopBlock::SidewayPipeMiddleTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_MIDDLE_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_MIDDLE_TOP_ID );
|
||||
}
|
||||
|
||||
SidewayPipeMiddleBottomBlock::SidewayPipeMiddleBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_MIDDLE_BOTTOM_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_MIDDLE_BOTTOM_ID );
|
||||
}
|
||||
|
||||
SidewayPipeConnectorTopBlock::SidewayPipeConnectorTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_CONNECTOR_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_CONNECTOR_TOP_ID );
|
||||
}
|
||||
|
||||
SidewayPipeConnectorBottomBlock::SidewayPipeConnectorBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
SIDEWAY_PIPE_CONNECTOR_BOTTOM_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( SIDEWAY_PIPE_CONNECTOR_BOTTOM_ID );
|
||||
}
|
||||
|
||||
TreePlatformTopLeftBlock::TreePlatformTopLeftBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
TREE_PLATFORM_TOP_LEFT_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_PLATFORM_TOP_LEFT_ID );
|
||||
}
|
||||
|
||||
TreePlatformTopMiddleBlock::TreePlatformTopMiddleBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
TREE_PLATFORM_TOP_MIDDLE_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_PLATFORM_TOP_MIDDLE_ID );
|
||||
}
|
||||
|
||||
TreePlatformTopRightBlock::TreePlatformTopRightBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
TREE_PLATFORM_TOP_RIGHT_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_PLATFORM_TOP_RIGHT_ID );
|
||||
}
|
||||
|
||||
TreePlatformBarkBlock::TreePlatformBarkBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, TREE_PLATFORM_BARK_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_PLATFORM_BARK_ID );
|
||||
}
|
||||
|
||||
WaterTopBlock::WaterTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, WATER_TOP_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( WATER_TOP_ID );
|
||||
}
|
||||
|
||||
WaterFillBlock::WaterFillBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, WATER_FILL_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( WATER_FILL_ID );
|
||||
}
|
||||
|
||||
MushroomPlatformTopLeftBlock::MushroomPlatformTopLeftBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
MUSHROOM_PLATFORM_TOP_LEFT_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( MUSHROOM_PLATFORM_TOP_LEFT_ID );
|
||||
}
|
||||
|
||||
MushroomPlatformTopMiddleBlock::MushroomPlatformTopMiddleBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
MUSHROOM_PLATFORM_TOP_MIDDLE_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( MUSHROOM_PLATFORM_TOP_MIDDLE_ID );
|
||||
}
|
||||
|
||||
MushroomPlatformTopRightBlock::MushroomPlatformTopRightBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
MUSHROOM_PLATFORM_TOP_RIGHT_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( MUSHROOM_PLATFORM_TOP_RIGHT_ID );
|
||||
}
|
||||
|
||||
MushroomPlatformBarkTopBlock::MushroomPlatformBarkTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
MUSHROOM_PLATFORM_BARK_TOP_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( MUSHROOM_PLATFORM_BARK_TOP_ID );
|
||||
}
|
||||
|
||||
MushroomPlatformBarkBottomBlock::MushroomPlatformBarkBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture,
|
||||
MUSHROOM_PLATFORM_BARK_BOTTOM_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( MUSHROOM_PLATFORM_BARK_BOTTOM_ID );
|
||||
}
|
||||
|
||||
TreeBarkBlock::TreeBarkBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, TREE_BARK_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_BARK_ID );
|
||||
}
|
||||
|
||||
TreeLeavesSmallBlock::TreeLeavesSmallBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, TREE_LEAVES_SMALL_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_LEAVES_SMALL_ID );
|
||||
}
|
||||
|
||||
TreeLeavesTopBlock::TreeLeavesTopBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, TREE_LEAVES_TOP_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_LEAVES_TOP_ID );
|
||||
}
|
||||
|
||||
TreeLeavesBottomBlock::TreeLeavesBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, TREE_LEAVES_BOTTOM_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( TREE_LEAVES_BOTTOM_ID );
|
||||
}
|
||||
|
||||
CannonTowerBlock::CannonTowerBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CANNON_TOWER_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( CANNON_TOWER_ID );
|
||||
}
|
||||
|
||||
CannonPedestalBlock::CannonPedestalBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CANNON_PEDESTAL_SRC,
|
||||
false ) {
|
||||
ensureCollision();
|
||||
setId( CANNON_PEDESTAL_ID );
|
||||
}
|
||||
|
||||
CannonBlock::CannonBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer )
|
||||
: MarioBlock( x, y, renderer, g_terrain_texture, CANNON_SRC, false ) {
|
||||
ensureCollision();
|
||||
setId( CANNON_ID );
|
||||
}
|
||||
|
||||
DestructibleModifierBlock::DestructibleModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer ) : MarioBlock( x, y, renderer, g_mod_texture, MOD_DESTRUCTIBLE_SRC, false ) {
|
||||
setId( DESTRUCTIBLE_MODIFIER_ID );
|
||||
}
|
||||
BackgroundModifierBlock::BackgroundModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer ) : MarioBlock (x, y, renderer, g_mod_texture, MOD_BACKGROUND_SRC, false ) {
|
||||
setId( BACKGROUND_MODIFIER_ID );
|
||||
}
|
||||
CoinModifierBlock::CoinModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer ) : MarioBlock (x, y, renderer, g_mod_texture, MOD_COIN_SRC, false ) {
|
||||
setId( COIN_MODIFIER_ID );
|
||||
}
|
||||
MushroomModifierBlock::MushroomModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer ) : MarioBlock (x, y, renderer, g_mod_texture, MOD_MUSHROOM_SRC, false ) {
|
||||
setId( MUSHROOM_MODIFIER_ID );
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
#ifndef SIMPLE_BLOCKS_HPP
|
||||
#define SIMPLE_BLOCKS_HPP
|
||||
|
||||
#include "../blocks.hpp"
|
||||
|
||||
class FloorBlock : public MarioBlock {
|
||||
public:
|
||||
FloorBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillInclineBlock : public MarioBlock {
|
||||
public:
|
||||
HillInclineBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillDeclineBlock : public MarioBlock {
|
||||
public:
|
||||
HillDeclineBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillDotsRightBlock : public MarioBlock {
|
||||
public:
|
||||
HillDotsRightBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillDotsLeftBlock : public MarioBlock {
|
||||
public:
|
||||
HillDotsLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillFillBlock : public MarioBlock {
|
||||
public:
|
||||
HillFillBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class HillTopBlock : public MarioBlock {
|
||||
public:
|
||||
HillTopBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BushLeftBlock : public MarioBlock {
|
||||
public:
|
||||
BushLeftBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BushMiddleBlock : public MarioBlock {
|
||||
public:
|
||||
BushMiddleBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BushRightBlock : public MarioBlock {
|
||||
public:
|
||||
BushRightBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudLeftBottomBlock : public MarioBlock {
|
||||
public:
|
||||
CloudLeftBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudMiddleBottomBlock : public MarioBlock {
|
||||
public:
|
||||
CloudMiddleBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudRightBottomBlock : public MarioBlock {
|
||||
public:
|
||||
CloudRightBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudLeftTopBlock : public MarioBlock {
|
||||
public:
|
||||
CloudLeftTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudMiddleTopBlock : public MarioBlock {
|
||||
public:
|
||||
CloudMiddleTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CloudRightTopBlock : public MarioBlock {
|
||||
public:
|
||||
CloudRightTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PipeLeftBottomBlock : public MarioBlock {
|
||||
public:
|
||||
PipeLeftBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PipeRightBottomBlock : public MarioBlock {
|
||||
public:
|
||||
PipeRightBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PipeLeftTopBlock : public MarioBlock {
|
||||
public:
|
||||
PipeLeftTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PipeRightTopBlock : public MarioBlock {
|
||||
public:
|
||||
PipeRightTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleLeftBlock : public MarioBlock {
|
||||
public:
|
||||
CastleLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleRightBlock : public MarioBlock {
|
||||
public:
|
||||
CastleRightBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleBlackBlock : public MarioBlock {
|
||||
public:
|
||||
CastleBlackBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleEntryBlock : public MarioBlock {
|
||||
public:
|
||||
CastleEntryBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleTowerBlock : public MarioBlock {
|
||||
public:
|
||||
CastleTowerBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CastleTowerFilledBlock : public MarioBlock {
|
||||
public:
|
||||
CastleTowerFilledBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class VineTopBlock : public MarioBlock {
|
||||
public:
|
||||
VineTopBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class VineBottomBlock : public MarioBlock {
|
||||
public:
|
||||
VineBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PoleTopBlock : public MarioBlock {
|
||||
public:
|
||||
PoleTopBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class PoleBottomBlock : public MarioBlock {
|
||||
public:
|
||||
PoleBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class FlagBlock : public MarioBlock {
|
||||
public:
|
||||
FlagBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class StepBlock : public MarioBlock {
|
||||
public:
|
||||
StepBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BrickBlock : public MarioBlock {
|
||||
public:
|
||||
BrickBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BrickTopBlock : public MarioBlock {
|
||||
public:
|
||||
BrickTopBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeEndTopBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeEndTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeEndBottomBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeEndBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeMiddleTopBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeMiddleTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeMiddleBottomBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeMiddleBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeConnectorTopBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeConnectorTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class SidewayPipeConnectorBottomBlock : public MarioBlock {
|
||||
public:
|
||||
SidewayPipeConnectorBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreePlatformTopLeftBlock : public MarioBlock {
|
||||
public:
|
||||
TreePlatformTopLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreePlatformTopMiddleBlock : public MarioBlock {
|
||||
public:
|
||||
TreePlatformTopMiddleBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreePlatformTopRightBlock : public MarioBlock {
|
||||
public:
|
||||
TreePlatformTopRightBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreePlatformBarkBlock : public MarioBlock {
|
||||
public:
|
||||
TreePlatformBarkBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class WaterTopBlock : public MarioBlock {
|
||||
public:
|
||||
WaterTopBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class WaterFillBlock : public MarioBlock {
|
||||
public:
|
||||
WaterFillBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomPlatformTopLeftBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomPlatformTopLeftBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomPlatformTopMiddleBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomPlatformTopMiddleBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomPlatformTopRightBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomPlatformTopRightBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomPlatformBarkTopBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomPlatformBarkTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomPlatformBarkBottomBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomPlatformBarkBottomBlock(
|
||||
int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreeBarkBlock : public MarioBlock {
|
||||
public:
|
||||
TreeBarkBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreeLeavesSmallBlock : public MarioBlock {
|
||||
public:
|
||||
TreeLeavesSmallBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreeLeavesTopBlock : public MarioBlock {
|
||||
public:
|
||||
TreeLeavesTopBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class TreeLeavesBottomBlock : public MarioBlock {
|
||||
public:
|
||||
TreeLeavesBottomBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CannonTowerBlock : public MarioBlock {
|
||||
public:
|
||||
CannonTowerBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CannonPedestalBlock : public MarioBlock {
|
||||
public:
|
||||
CannonPedestalBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CannonBlock : public MarioBlock {
|
||||
public:
|
||||
CannonBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
|
||||
//------------------ MODS------------------------------------------------------
|
||||
class DestructibleModifierBlock : public MarioBlock {
|
||||
public:
|
||||
DestructibleModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class BackgroundModifierBlock : public MarioBlock {
|
||||
public:
|
||||
BackgroundModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class CoinModifierBlock : public MarioBlock {
|
||||
public:
|
||||
CoinModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
class MushroomModifierBlock : public MarioBlock {
|
||||
public:
|
||||
MushroomModifierBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer );
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user