Mario: custom mario class

This commit is contained in:
2021-05-22 23:13:26 +02:00
parent 0358aa36c7
commit d9a88f2de2
4 changed files with 97 additions and 69 deletions
+20
View File
@@ -0,0 +1,20 @@
#ifndef MARIO_H
#define MARIO_H
#include "../sdlpp/sdlpp_rectrenderer.hpp"
#include "mario_visitor.hpp"
class Mario : public SDLPP::RectangleRender {
public:
Mario(const std::shared_ptr< SDLPP::Renderer > &renderer);
void walkLeft();
void walkRight();
void setStanding();
void handleVisitor(MarioVisitor &visitor, SDLPP::Vec2D<double> previous_position);
private:
bool faces_right = true;
double side_movement = 0.8;
double fall_movement = 1;
};
#endif