From e061924a481b8cd004442c2f0b1caf59c3ad0380 Mon Sep 17 00:00:00 2001 From: Shulga Konstantin Date: Wed, 16 Sep 2020 16:35:25 +0300 Subject: [PATCH] fix: change the bounce of the sprite from the edge of the screen --- Lab_1/Lab_1/Lab_1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab_1/Lab_1/Lab_1.cpp b/Lab_1/Lab_1/Lab_1.cpp index 8b0a543..2b9b658 100644 --- a/Lab_1/Lab_1/Lab_1.cpp +++ b/Lab_1/Lab_1/Lab_1.cpp @@ -93,7 +93,7 @@ COORD CreateNewSpritePosition(COORD spritePosition, COORD spriteSteps, HWND hWnd newSpritePosition.X = spritePosition.X + spriteSteps.X; if (newSpritePosition.X < 0) { - newSpritePosition.X = 0 + SPRITE_STEP + 90; + newSpritePosition.X = 0 + SPRITE_STEP; } else if (newSpritePosition.X + spriteSize.cx > windowSize.cx) {