   --cięcie--
     if (checkPaddleCollision(ball, rightPaddle)) {
       // Doszło do kolizji z prawą paletką
       let distanceFromTop = ball.top - rightPaddle.top;
       let distanceFromBottom = rightPaddle.bottom - ball.bottom;
       adjustAngle(distanceFromTop, distanceFromBottom);
       xSpeed = -Math.abs(xSpeed);
     }

     if (ball.left < 0) {
       rightScore++;
       initBall();
     }
     if (ball.right > width) {
       leftScore++;
       initBall();
     }

     if (ball.top < 0 || ball.bottom > height) {
       ySpeed = -ySpeed;
     }
}
   --cięcie--
