From 0b8dcc983ddf4cabf0270787c917403a6fee7111 Mon Sep 17 00:00:00 2001 From: Giri Ramaraju Date: Sat, 3 Apr 2021 11:18:20 +0530 Subject: [PATCH] Update rect8.py Fix the speed component's inversion logic. --- docs/rect/rect8.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rect/rect8.py b/docs/rect/rect8.py index 9d4fae4..8c4dee4 100644 --- a/docs/rect/rect8.py +++ b/docs/rect/rect8.py @@ -11,11 +11,11 @@ rect.move_ip(v) if rect.left < 0: - v[0] *= -1 + v[0] *= 1 if rect.right > width: v[0] *= -1 if rect.top < 0: - v[1] *= -1 + v[1] *= 1 if rect.bottom > height: v[1] *= -1 @@ -23,4 +23,4 @@ pygame.draw.rect(screen, RED, rect) pygame.display.flip() -pygame.quit() \ No newline at end of file +pygame.quit()