Add infinite rectangles, make scene move when player gets near the screen's edge

This commit is contained in:
2020-07-28 19:35:31 +02:00
parent 847b5cbd8e
commit 9db93cd72c
3 changed files with 88 additions and 18 deletions
+3 -1
View File
@@ -66,9 +66,11 @@ bool SDLPP::Rect::colidesWith(const SDLPP::CollisionPolygon &other) const {
if(other.isCircle()) {
return other.colidesWith(*this);
}
if(other.isInfinite()) {
if(other.isInfinite() ) {
return infinityIntersection(other, *this);
}
if(isInfinite())
return infinityIntersection(*this, other);
return intersects(*this, other);
}