From e92a3120c767ea8e6c89f3e81c8258093e8c26e6 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Fri, 6 Apr 2012 13:17:23 +0200 Subject: [PATCH] Fixed a bug in the pong example --- examples/pong/Pong.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/pong/Pong.cpp b/examples/pong/Pong.cpp index 1363b1a8..1b9a74fc 100644 --- a/examples/pong/Pong.cpp +++ b/examples/pong/Pong.cpp @@ -104,6 +104,7 @@ int main() { // (re)start the game isPlaying = true; + clock.restart(); // Reset the position of the paddles and ball leftPaddle.setPosition(10 + paddleSize.x / 2, gameHeight / 2); @@ -166,7 +167,7 @@ int main() isPlaying = false; pauseMessage.setString("You lost !\nPress space to restart or\nescape to exit"); } - if (ball.getPosition().x + ballRadius > 800) + if (ball.getPosition().x + ballRadius > gameWidth) { isPlaying = false; pauseMessage.setString("You won !\nPress space to restart or\nescape to exit");