Refactor to use objects for terrain/mod creation, added coin modifier

This commit is contained in:
2021-07-23 00:08:05 +02:00
parent 79d9f266b4
commit 3be728843a
15 changed files with 1384 additions and 127 deletions
+10 -1
View File
@@ -3,7 +3,7 @@
#include "objectids.hpp"
#include "sprites.hpp"
Mario::Mario(const std::shared_ptr< SDLPP::Renderer > &renderer) : SDLPP::RectangleRender(0, 0, BLOCK_SIZE, BLOCK_SIZE, renderer, g_mario_texture, MARIO_STANDING_SRC) {
Mario::Mario(int x, int y, const std::shared_ptr< SDLPP::Renderer > &renderer) : MarioBlock(x, y, renderer, g_mario_texture, MARIO_STANDING_SRC) {
setAnimationFrames( MARIO_WALK_ANIM );
setId( MARIO_ID );
setAlignment( SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER );
@@ -29,6 +29,7 @@ Mario::Mario(const std::shared_ptr< SDLPP::Renderer > &renderer) : SDLPP::Rectan
setColiderColor("#FF0000");
setStatic( false );
}
Mario::Mario(const std::shared_ptr< SDLPP::Renderer > &renderer) : Mario(0, 0, renderer) {}
void Mario::walkLeft() {
if(on_ground)
resumeAnimation();
@@ -138,3 +139,11 @@ void Mario::custom_move( int ticks ) {
ticks_till_gravity += base_gravity_ticks;
}
}
void Mario::visit(SDLPP::Visitor &/*UNUSED*/) {
// TODO
}
void Mario::setWorldTypeSrc(LandType::Value /*UNUSED*/) {
// TODO
}