Browse Source

After game over, ball goes horizontally on resume

master
Kenneth Bruen 3 years ago
parent
commit
95d8597377
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 2
      src/main.cpp

2
src/main.cpp

@ -155,12 +155,14 @@ void idle() {
// Ball exited board on the left side
rightScore += 1;
ball.x = ball.y = 0;
ball.veloY = 0;
gameRunning = false;
}
else if (ball.x - ball.radius > 1) {
// Ball exited board on the right side
leftScore += 1;
ball.x = ball.y = 0;
ball.veloY = 0;
gameRunning = false;
}
else if (ball.y - ball.radius < -1) {

Loading…
Cancel
Save