Update script.js
Browse files
script.js
CHANGED
|
@@ -31,11 +31,10 @@ function jump() {
|
|
| 31 |
}, 20);
|
| 32 |
}
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
});
|
| 39 |
|
| 40 |
function moveObstacle() {
|
| 41 |
obstaclePosition -= 5;
|
|
|
|
| 31 |
}, 20);
|
| 32 |
}
|
| 33 |
|
| 34 |
+
// Listen for touch events
|
| 35 |
+
document.addEventListener('touchstart', (event) => {
|
| 36 |
+
jump();
|
| 37 |
+
}, { passive: true });
|
|
|
|
| 38 |
|
| 39 |
function moveObstacle() {
|
| 40 |
obstaclePosition -= 5;
|