if (predBall.getGlobalBounds().left > 0 && predBall.getGlobalBounds().left + predBall.getGlobalBounds().width + 25.f < screenWidth)
{
predBall.move(predBallVel.x * deltaTime.asSeconds() * 1.3f, predBallVel.y * deltaTime.asSeconds() * 1.3f);
}
if (ball.getPosition().x >= screenWidth / 2.f)
{
if (rightBat.getGlobalBounds().top + rightBat.getGlobalBounds().height / 2.f < predBall.getPosition().y && !rightBat.getGlobalBounds().intersects(predBall.getGlobalBounds()))
{
rightBat.move(0, paddleSpeed * deltaTime.asSeconds());
if (rightBat.getGlobalBounds().top + rightBat.getGlobalBounds().height >= screenHeight)
rightBat.move(0, -paddleSpeed * deltaTime.asSeconds());
}
else if (rightBat.getGlobalBounds().top + rightBat.getGlobalBounds().height / 2.f > predBall.getPosition().y && !rightBat.getGlobalBounds().intersects(predBall.getGlobalBounds()))
{
rightBat.move(0, -botPaddleSpeed * deltaTime.asSeconds());
if (rightBat.getGlobalBounds().top <= 0)
rightBat.move(0, botPaddleSpeed * deltaTime.asSeconds());
}
}