cutechicken commited on
Commit
55f177c
β€’
1 Parent(s): f681fcc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +40 -26
index.html CHANGED
@@ -170,19 +170,7 @@
170
  border-radius: 5px;
171
  }
172
 
173
- #turretInfo {
174
- position: absolute;
175
- top: 50px;
176
- right: 20px;
177
- color: #0f0;
178
- background: rgba(0,20,0,0.7);
179
- padding: 10px;
180
- font-size: 16px;
181
- z-index: 1001;
182
- border: 1px solid #0f0;
183
- border-radius: 5px;
184
- }
185
-
186
  #gameTitle {
187
  position: absolute;
188
  top: 10px;
@@ -225,7 +213,7 @@
225
 
226
  #radar {
227
  position: absolute;
228
- bottom: 20px;
229
  left: 20px;
230
  width: 200px;
231
  height: 200px;
@@ -235,6 +223,19 @@
235
  z-index: 1001;
236
  overflow: hidden;
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  #radarLine {
240
  position: absolute;
@@ -303,9 +304,16 @@
303
  cursor: pointer;
304
  margin-top: 20px;
305
  transition: transform 0.2s;
 
 
 
 
 
 
 
306
  }
307
 
308
- .start-button:hover {
309
  transform: scale(1.1);
310
  }
311
 
@@ -328,9 +336,9 @@
328
  <div class="loading-text">Loading tank assets...</div>
329
  </div>
330
 
331
- <div class="start-screen" id="startScreen">
332
  <h1 style="color: #0f0; font-size: 48px; margin-bottom: 20px;">Tank Combat Simulator</h1>
333
- <button class="start-button" onclick="startGame()">Start Game</button>
334
  <div style="color: #0f0; margin-top: 20px; text-align: center;">
335
  <p>Controls:</p>
336
  <p>W,A,S,D - Move Tank</p>
@@ -343,6 +351,7 @@
343
 
344
  <div id="gameContainer">
345
  <div id="gameTitle">Tank Combat Simulator</div>
 
346
  <div id="gameStats">
347
  <div id="score">Score: 0</div>
348
  <div id="time">Time: 180s</div>
@@ -355,9 +364,6 @@
355
  <div id="health"></div>
356
  </div>
357
 
358
- <!-- 포탑 정보 -->
359
- <div id="turretInfo">Turret Angle: 0Β°</div>
360
-
361
  <!-- μƒˆλ‘œμš΄ 탄약 μ‹œμŠ€ν…œ -->
362
  <div id="ammoDisplay">APFSDS: 1/1</div>
363
 
@@ -370,8 +376,6 @@
370
  </div>
371
  </div>
372
 
373
- </div>
374
-
375
  <script type="importmap">
376
  {
377
  "imports": {
@@ -381,12 +385,22 @@
381
  }
382
  </script>
383
  <script>
384
- function startGame() {
385
- document.getElementById('startScreen').style.display = 'none';
386
- // 여기에 κ²Œμž„ μ‹œμž‘ 둜직 μΆ”κ°€
387
- document.body.requestPointerLock();
 
 
388
  }
389
 
 
 
 
 
 
 
 
 
390
  // 포인터 락 이벀트 처리
391
  document.addEventListener('pointerlockchange', () => {
392
  if (document.pointerLockElement === document.body) {
 
170
  border-radius: 5px;
171
  }
172
 
173
+
 
 
 
 
 
 
 
 
 
 
 
 
174
  #gameTitle {
175
  position: absolute;
176
  top: 10px;
 
213
 
214
  #radar {
215
  position: absolute;
216
+ bottom: 60px; /* 체λ ₯λ°” μœ„λ‘œ 이동 */
217
  left: 20px;
218
  width: 200px;
219
  height: 200px;
 
223
  z-index: 1001;
224
  overflow: hidden;
225
  }
226
+
227
+ #mission {
228
+ position: absolute;
229
+ top: 10px;
230
+ left: 10px;
231
+ color: #0f0;
232
+ background: rgba(0,20,0,0.7);
233
+ padding: 10px;
234
+ font-size: 16px;
235
+ z-index: 1001;
236
+ border: 1px solid #0f0;
237
+ border-radius: 5px;
238
+ }
239
 
240
  #radarLine {
241
  position: absolute;
 
304
  cursor: pointer;
305
  margin-top: 20px;
306
  transition: transform 0.2s;
307
+ /* μ‹œμž‘ μ‹œ λΉ„ν™œμ„±ν™” μƒνƒœ */
308
+ opacity: 0.5;
309
+ pointer-events: none;
310
+ }
311
+ .start-button.ready {
312
+ opacity: 1;
313
+ pointer-events: auto;
314
  }
315
 
316
+ .start-button.ready:hover {
317
  transform: scale(1.1);
318
  }
319
 
 
336
  <div class="loading-text">Loading tank assets...</div>
337
  </div>
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>
 
351
 
352
  <div id="gameContainer">
353
  <div id="gameTitle">Tank Combat Simulator</div>
354
+ <div id="mission">MISSION: SURVIVE 180 SEC</div>
355
  <div id="gameStats">
356
  <div id="score">Score: 0</div>
357
  <div id="time">Time: 180s</div>
 
364
  <div id="health"></div>
365
  </div>
366
 
 
 
 
367
  <!-- μƒˆλ‘œμš΄ 탄약 μ‹œμŠ€ν…œ -->
368
  <div id="ammoDisplay">APFSDS: 1/1</div>
369
 
 
376
  </div>
377
  </div>
378
 
 
 
379
  <script type="importmap">
380
  {
381
  "imports": {
 
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) {