Update index.html
Browse files- index.html +4 -4
index.html
CHANGED
@@ -41,7 +41,7 @@
|
|
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 fallSpeed = 0.5; // Kecepatan bola yang konsisten
|
45 |
|
46 |
// Fungsi untuk memindahkan platform ke kiri
|
47 |
function movePlatformLeft() {
|
@@ -86,7 +86,7 @@
|
|
86 |
// Fungsi untuk menggerakkan bola
|
87 |
function moveBall() {
|
88 |
if (isCaught) return; // Jangan lanjut jika bola ditangkap.
|
89 |
-
ballPosition.top += fallSpeed; // Bola turun dengan kecepatan
|
90 |
ball.style.top = ballPosition.top + '%';
|
91 |
ball.style.left = ballPosition.left + '%';
|
92 |
|
@@ -118,8 +118,8 @@
|
|
118 |
ball.style.top = ballPosition.top + '%';
|
119 |
platform.style.left = platformPosition + '%';
|
120 |
isCaught = false;
|
121 |
-
// Kecepatan bola
|
122 |
-
fallSpeed = 0.5;
|
123 |
}
|
124 |
|
125 |
// Fungsi untuk menampilkan overlay Game Over
|
|
|
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 fallSpeed = 0.5; // Kecepatan bola yang konsisten
|
45 |
|
46 |
// Fungsi untuk memindahkan platform ke kiri
|
47 |
function movePlatformLeft() {
|
|
|
86 |
// Fungsi untuk menggerakkan bola
|
87 |
function moveBall() {
|
88 |
if (isCaught) return; // Jangan lanjut jika bola ditangkap.
|
89 |
+
ballPosition.top += fallSpeed; // Bola turun dengan kecepatan yang tetap
|
90 |
ball.style.top = ballPosition.top + '%';
|
91 |
ball.style.left = ballPosition.left + '%';
|
92 |
|
|
|
118 |
ball.style.top = ballPosition.top + '%';
|
119 |
platform.style.left = platformPosition + '%';
|
120 |
isCaught = false;
|
121 |
+
// Kecepatan bola tetap konsisten (0.5)
|
122 |
+
fallSpeed = 0.5;
|
123 |
}
|
124 |
|
125 |
// Fungsi untuk menampilkan overlay Game Over
|