Spaces:
Running
Running
Update index.html
Browse files- index.html +10 -1
index.html
CHANGED
@@ -684,6 +684,7 @@
|
|
684 |
function restartGame() {
|
685 |
endScreen.style.opacity = '0';
|
686 |
endScreen.style.pointerEvents = 'none';
|
|
|
687 |
generateTerrain();
|
688 |
resetLander();
|
689 |
}
|
@@ -848,6 +849,14 @@
|
|
848 |
|
849 |
// Update angle with damping to prevent excessive spinning
|
850 |
lander.angle += lander.rotationSpeed * delta;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
|
852 |
// Apply gravity
|
853 |
lander.velocityY += gravity * delta;
|
@@ -1070,5 +1079,5 @@
|
|
1070 |
// Start the game
|
1071 |
window.addEventListener('load', init);
|
1072 |
</script>
|
1073 |
-
|
1074 |
</html>
|
|
|
684 |
function restartGame() {
|
685 |
endScreen.style.opacity = '0';
|
686 |
endScreen.style.pointerEvents = 'none';
|
687 |
+
angleIndicator.style.display = 'flex';
|
688 |
generateTerrain();
|
689 |
resetLander();
|
690 |
}
|
|
|
849 |
|
850 |
// Update angle with damping to prevent excessive spinning
|
851 |
lander.angle += lander.rotationSpeed * delta;
|
852 |
+
|
853 |
+
// Angle checks
|
854 |
+
if (lander.angle < (- Math.PI)) {
|
855 |
+
lander.angle = 2 * Math.PI + lander.angle;
|
856 |
+
} else if (lander.angle >= (Math.PI)) {
|
857 |
+
lander.angle = lander.angle - 2 * Math.PI;
|
858 |
+
}
|
859 |
+
|
860 |
|
861 |
// Apply gravity
|
862 |
lander.velocityY += gravity * delta;
|
|
|
1079 |
// Start the game
|
1080 |
window.addEventListener('load', init);
|
1081 |
</script>
|
1082 |
+
</body>
|
1083 |
</html>
|