From a4656d6aa1fde37f4c121fae1c0b3a7afa1cd9b3 Mon Sep 17 00:00:00 2001 From: HarIgo23 <33521581+HarIgo23@users.noreply.github.com> Date: Sat, 9 Mar 2024 19:46:58 +0300 Subject: [PATCH] Fix bug in Chapter2/BGSpriteComponent.cpp --- Chapter02/BGSpriteComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter02/BGSpriteComponent.cpp b/Chapter02/BGSpriteComponent.cpp index 4c143704..c438e131 100644 --- a/Chapter02/BGSpriteComponent.cpp +++ b/Chapter02/BGSpriteComponent.cpp @@ -26,7 +26,7 @@ void BGSpriteComponent::Update(float deltaTime) // the right of the last bg texture if (bg.mOffset.x < -mScreenSize.x) { - bg.mOffset.x = (mBGTextures.size() - 1) * mScreenSize.x - 1; + bg.mOffset.x += mScreenSize.x * mBGTextures.size(); } } }