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

   function drawGameOver() {
     ctx.fillStyle = "white";
     ctx.font = "30px monospace";
     ctx.textAlign = "center";
     ctx.fillText("KONIEC GRY", width / 2, height / 2);
   }

   function gameLoop() {
     draw();
     update();
     checkCollision();
     if (gameOver) {
       draw();
       drawGameOver();
     } else {
       // Ponowne wywołanie tej funkcji po upływie określonego czasu
       setTimeout(gameLoop, 30);
     }
   }
