Remove redundant functions from blocks.cpp, fix editor problem with pagination

This commit is contained in:
2021-07-24 19:59:25 +02:00
parent 3be728843a
commit d638108223
8 changed files with 113 additions and 381 deletions
+10 -10
View File
@@ -6,19 +6,19 @@
#include "sprites.hpp"
#include "blocks.hpp"
// TODO change to MarioBlock instead of RectangleRender
class Mario : public MarioBlock {
public:
Mario(int x, int y, const std::shared_ptr< SDLPP::Renderer > &renderer);
Mario(const std::shared_ptr< SDLPP::Renderer > &renderer);
Mario( int x, int y, const std::shared_ptr< SDLPP::Renderer > &renderer );
Mario( const std::shared_ptr< SDLPP::Renderer > &renderer );
void walkLeft();
void walkRight();
void setStanding();
void handleVisitor(MarioVisitor &visitor);
void handleVisitor( MarioVisitor &visitor );
void jump();
void stopJump();
virtual void custom_move( int ticks ) override;
void visit(SDLPP::Visitor &visitor) override;
void visit( SDLPP::Visitor &visitor ) override;
private:
bool faces_right = true;
double side_movement = 0.39;
@@ -31,11 +31,11 @@ private:
bool on_ground = true;
int ticks_till_gravity = 0;
// gravity should be added every frame in 60fps game
const int base_gravity_ticks = 1000/60;
const double gravity_add_jumping = jump_movement/32.0;
const double gravity_add_falling = jump_movement/(64.0/7.0);
std::shared_ptr<SDLPP::RectColider> top_collision = nullptr;
virtual void setWorldTypeSrc(LandType::Value world) override;
const int base_gravity_ticks = 1000 / 60;
const double gravity_add_jumping = jump_movement / 32.0;
const double gravity_add_falling = jump_movement / ( 64.0 / 7.0 );
std::shared_ptr< SDLPP::RectColider > top_collision = nullptr;
virtual void setWorldTypeSrc( LandType::Value world ) override;
};
#endif