Refactor to use objects for terrain/mod creation, added coin modifier
This commit is contained in:
+6
-1
@@ -4,9 +4,12 @@
|
||||
#include "../sdlpp/sdlpp_rectrenderer.hpp"
|
||||
#include "mario_visitor.hpp"
|
||||
#include "sprites.hpp"
|
||||
#include "blocks.hpp"
|
||||
|
||||
class Mario : public SDLPP::RectangleRender {
|
||||
// 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);
|
||||
void walkLeft();
|
||||
void walkRight();
|
||||
@@ -15,6 +18,7 @@ public:
|
||||
void jump();
|
||||
void stopJump();
|
||||
virtual void custom_move( int ticks ) override;
|
||||
void visit(SDLPP::Visitor &visitor) override;
|
||||
private:
|
||||
bool faces_right = true;
|
||||
double side_movement = 0.39;
|
||||
@@ -31,6 +35,7 @@ private:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user