Mario: detect left/right collision

This commit is contained in:
2021-04-29 12:33:31 +02:00
parent e8e9e12b58
commit b611e2479a
5 changed files with 19 additions and 11 deletions
+8
View File
@@ -23,6 +23,12 @@ public:
virtual void fromId( uint64_t id ) override {
from = id;
}
bool canGoLeft() {
return !left;
}
bool canGoRight() {
return !right;
}
private:
bool onGround = false;
@@ -30,6 +36,8 @@ private:
bool stop = false;
double newX;
uint64_t from = -1;
bool left = false;
bool right = false;
};
#endif