cutechicken commited on
Commit
f043b41
·
verified ·
1 Parent(s): 7d05cf8

Update index.html

Browse files
Files changed (1) hide show
  1. 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" id="startButton" disabled>Loading...</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
- if (document.getElementById('startButton').classList.contains('ready')) {
399
- document.getElementById('startScreen').style.display = 'none';
400
- document.body.requestPointerLock();
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) {