Mario: only visit objects if they entered screen at least once

This commit is contained in:
2021-08-07 22:25:32 +02:00
parent f7002f0f38
commit 4f65dba2e0
3 changed files with 17 additions and 1 deletions
+3
View File
@@ -42,6 +42,8 @@ public:
bool isBouncing() const;
bool isTraveling() const;
void setBaseRect(SDL_Rect rect);
void checkVisibility(double rightmost_x);
bool wasVisible() const;
protected:
double bounce_speed = 0.5;
@@ -83,6 +85,7 @@ private:
int _base_gravity_ticks = 1000 / 60;
int _ticks_till_gravity = 0;
double _gravity_acceleration = 1.0/(64.0/7.0);
bool _was_visible = false;
};
extern const std::vector< uint64_t > possibleBlocks;