GarGerry commited on
Commit
e1c3637
·
verified ·
1 Parent(s): ac83adc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1 -14
index.html CHANGED
@@ -41,7 +41,6 @@
41
  let ballPosition = { top: 0, left: Math.random() * 90 }; // Bola muncul secara acak.
42
  let isCaught = false; // Apakah bola ditangkap.
43
  let score = 0; // Skor awal.
44
- let ballSpeed = 1.5; // Kecepatan bola
45
 
46
  // Fungsi untuk memindahkan platform ke kiri
47
  function movePlatformLeft() {
@@ -86,7 +85,7 @@
86
  // Fungsi untuk menggerakkan bola
87
  function moveBall() {
88
  if (isCaught) return; // Jangan lanjut jika bola ditangkap.
89
- ballPosition.top += ballSpeed; // Bola turun.
90
  ball.style.top = ballPosition.top + '%';
91
  ball.style.left = ballPosition.left + '%';
92
 
@@ -95,7 +94,6 @@
95
  isCaught = true;
96
  score++; // Tambahkan skor.
97
  scoreDisplay.textContent = score; // Update skor di layar.
98
- adjustBallSpeed(); // Sesuaikan kecepatan bola berdasarkan skor.
99
  resetGame();
100
  }
101
 
@@ -110,17 +108,6 @@
110
  requestAnimationFrame(moveBall);
111
  }
112
 
113
- // Fungsi untuk menyesuaikan kecepatan bola berdasarkan skor
114
- function adjustBallSpeed() {
115
- if (score > 20) {
116
- ballSpeed = 2.5; // Meningkatkan kecepatan bola jika skor lebih dari 20
117
- } else if (score > 10) {
118
- ballSpeed = 2.0; // Kecepatan sedikit meningkat setelah skor 10
119
- } else {
120
- ballSpeed = 1.5; // Kecepatan bola di awal
121
- }
122
- }
123
-
124
  // Fungsi untuk mereset permainan
125
  function resetGame() {
126
  isCaught = false;
 
41
  let ballPosition = { top: 0, left: Math.random() * 90 }; // Bola muncul secara acak.
42
  let isCaught = false; // Apakah bola ditangkap.
43
  let score = 0; // Skor awal.
 
44
 
45
  // Fungsi untuk memindahkan platform ke kiri
46
  function movePlatformLeft() {
 
85
  // Fungsi untuk menggerakkan bola
86
  function moveBall() {
87
  if (isCaught) return; // Jangan lanjut jika bola ditangkap.
88
+ ballPosition.top += 0.8; // Bola turun lebih lambat
89
  ball.style.top = ballPosition.top + '%';
90
  ball.style.left = ballPosition.left + '%';
91
 
 
94
  isCaught = true;
95
  score++; // Tambahkan skor.
96
  scoreDisplay.textContent = score; // Update skor di layar.
 
97
  resetGame();
98
  }
99
 
 
108
  requestAnimationFrame(moveBall);
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
111
  // Fungsi untuk mereset permainan
112
  function resetGame() {
113
  isCaught = false;