Mario: don't let Mario go left

This commit is contained in:
2021-04-26 21:59:21 +02:00
parent dd6f37264c
commit b0b84101a2
4 changed files with 129 additions and 48 deletions
+16 -1
View File
@@ -2,20 +2,35 @@
#define MARIO_VISITOR_H
#include "../sdlpp/sdlpp_visitor.hpp"
#include "../sdlpp/sdlpp_geometry.hpp"
#include <bits/stdint-uintn.h>
class MarioVisitor : public SDLPP::Visitor {
public:
MarioVisitor() {}
virtual void visit( const SDLPP::RenderObject &obj );
virtual void visit( const SDLPP::RenderObject &obj ) override;
bool isOnGround() {
return onGround;
}
bool isDead() {
return death;
}
bool isStopped() {
return stop;
}
double newXPos() {
return newX;
}
virtual void fromId( uint64_t id ) override {
from = id;
}
private:
bool onGround = false;
bool death = false;
bool stop = false;
double newX;
uint64_t from = -1;
};
#endif