mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fixed a bug in the pong example
This commit is contained in:
parent
f3be2da018
commit
e92a3120c7
@ -104,6 +104,7 @@ int main()
|
|||||||
{
|
{
|
||||||
// (re)start the game
|
// (re)start the game
|
||||||
isPlaying = true;
|
isPlaying = true;
|
||||||
|
clock.restart();
|
||||||
|
|
||||||
// Reset the position of the paddles and ball
|
// Reset the position of the paddles and ball
|
||||||
leftPaddle.setPosition(10 + paddleSize.x / 2, gameHeight / 2);
|
leftPaddle.setPosition(10 + paddleSize.x / 2, gameHeight / 2);
|
||||||
@ -166,7 +167,7 @@ int main()
|
|||||||
isPlaying = false;
|
isPlaying = false;
|
||||||
pauseMessage.setString("You lost !\nPress space to restart or\nescape to exit");
|
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;
|
isPlaying = false;
|
||||||
pauseMessage.setString("You won !\nPress space to restart or\nescape to exit");
|
pauseMessage.setString("You won !\nPress space to restart or\nescape to exit");
|
||||||
|
Loading…
Reference in New Issue
Block a user