Mario: only visit objects if they entered screen at least once
This commit is contained in:
@@ -656,3 +656,12 @@ void MarioBlock::setBaseRect(SDL_Rect rect) {
|
||||
_base_src = rect;
|
||||
setType(getType());
|
||||
}
|
||||
void MarioBlock::checkVisibility(double rightmost_x) {
|
||||
// we assume that object's X > 0 as otherwise it would be destroyed
|
||||
if(!getHidden() && getAbsolutePos().getX() < rightmost_x) {
|
||||
_was_visible = true;
|
||||
}
|
||||
}
|
||||
bool MarioBlock::wasVisible() const {
|
||||
return _was_visible;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user