Skip to content

Commit a4656d6

Browse files
committed
Fix bug in Chapter2/BGSpriteComponent.cpp
1 parent 22372ca commit a4656d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Chapter02/BGSpriteComponent.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void BGSpriteComponent::Update(float deltaTime)
2626
// the right of the last bg texture
2727
if (bg.mOffset.x < -mScreenSize.x)
2828
{
29-
bg.mOffset.x = (mBGTextures.size() - 1) * mScreenSize.x - 1;
29+
bg.mOffset.x += mScreenSize.x * mBGTextures.size();
3030
}
3131
}
3232
}

0 commit comments

Comments
 (0)