From d78de8528daa861d9d45a3864b70b2a66438f06f Mon Sep 17 00:00:00 2001 From: Chetan Padia Date: Sat, 1 Sep 2018 22:21:22 +0100 Subject: [PATCH] hack to fix ball getting stuck --- breakout/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/breakout/main.py b/breakout/main.py index 5ddf7cc..5829ec4 100644 --- a/breakout/main.py +++ b/breakout/main.py @@ -189,7 +189,7 @@ def gameOver(score): def runGame(): paddle = Paddle() - direction = random.random() * 2 - 1 + direction = random.random() - 0.5 initial_speed_up = 4 ball = Ball(x = SCREEN_WIDTH / 2, y = SCREEN_HEIGHT / 2, dx = math.cos(direction) * initial_speed_up, dy = math.sin(direction) * initial_speed_up) blocks = \