Spaces:
Running
Running
cutechicken
commited on
Commit
โข
f043b41
1
Parent(s):
7d05cf8
Update index.html
Browse files- index.html +5 -15
index.html
CHANGED
@@ -338,7 +338,7 @@
|
|
338 |
|
339 |
<div class="start-screen" id="startScreen">
|
340 |
<h1 style="color: #0f0; font-size: 48px; margin-bottom: 20px;">Tank Combat Simulator</h1>
|
341 |
-
<button class="start-button"
|
342 |
<div style="color: #0f0; margin-top: 20px; text-align: center;">
|
343 |
<p>Controls:</p>
|
344 |
<p>W,A,S,D - Move Tank</p>
|
@@ -385,22 +385,12 @@
|
|
385 |
}
|
386 |
</script>
|
387 |
<script>
|
388 |
-
// ๊ฒ์ ๋ก๋ฉ ์๋ฃ ์ ํธ์ถ๋ ํจ์
|
389 |
-
function onGameLoaded() {
|
390 |
-
const startButton = document.getElementById('startButton');
|
391 |
-
startButton.textContent = 'Start Game';
|
392 |
-
startButton.classList.add('ready');
|
393 |
-
startButton.disabled = false;
|
394 |
-
}
|
395 |
-
|
396 |
-
// startGame ํจ์ ์์
|
397 |
function startGame() {
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
window.gameInstance.isStarted = true;
|
402 |
-
}
|
403 |
}
|
|
|
404 |
// ํฌ์ธํฐ ๋ฝ ์ด๋ฒคํธ ์ฒ๋ฆฌ
|
405 |
document.addEventListener('pointerlockchange', () => {
|
406 |
if (document.pointerLockElement === document.body) {
|
|
|
338 |
|
339 |
<div class="start-screen" id="startScreen">
|
340 |
<h1 style="color: #0f0; font-size: 48px; margin-bottom: 20px;">Tank Combat Simulator</h1>
|
341 |
+
<button class="start-button" onclick="startGame()">Start Game</button>
|
342 |
<div style="color: #0f0; margin-top: 20px; text-align: center;">
|
343 |
<p>Controls:</p>
|
344 |
<p>W,A,S,D - Move Tank</p>
|
|
|
385 |
}
|
386 |
</script>
|
387 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
function startGame() {
|
389 |
+
document.getElementById('startScreen').style.display = 'none';
|
390 |
+
// ์ฌ๊ธฐ์ ๊ฒ์ ์์ ๋ก์ง ์ถ๊ฐ
|
391 |
+
document.body.requestPointerLock();
|
|
|
|
|
392 |
}
|
393 |
+
|
394 |
// ํฌ์ธํฐ ๋ฝ ์ด๋ฒคํธ ์ฒ๋ฆฌ
|
395 |
document.addEventListener('pointerlockchange', () => {
|
396 |
if (document.pointerLockElement === document.body) {
|