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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<body>
|
13 |
-
<
|
14 |
-
|
15 |
-
<
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
</
|
20 |
-
|
21 |
-
<
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
</
|
|
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html>
|
|
|
3 |
<head>
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/stats.js/r17/Stats.min.js"></script>
|
7 |
+
<title>Tank Combat Simulator - FPS Mode</title>
|
8 |
+
<style>
|
9 |
+
body {
|
10 |
+
margin: 0;
|
11 |
+
overflow: hidden;
|
12 |
+
background: #000;
|
13 |
+
font-family: 'Courier New', monospace;
|
14 |
+
}
|
15 |
+
#enemyLabels {
|
16 |
+
position: absolute;
|
17 |
+
top: 0;
|
18 |
+
left: 0;
|
19 |
+
width: 100%;
|
20 |
+
height: 100%;
|
21 |
+
pointer-events: none;
|
22 |
+
}
|
23 |
+
|
24 |
+
.enemy-label {
|
25 |
+
position: absolute;
|
26 |
+
background-color: rgba(255, 0, 0, 0.7);
|
27 |
+
color: white;
|
28 |
+
padding: 2px 6px;
|
29 |
+
border-radius: 3px;
|
30 |
+
font-size: 12px;
|
31 |
+
font-family: Arial, sans-serif;
|
32 |
+
transform: translate(-50%, -50%);
|
33 |
+
white-space: nowrap;
|
34 |
+
}
|
35 |
+
#loading {
|
36 |
+
position: fixed;
|
37 |
+
top: 50%;
|
38 |
+
left: 50%;
|
39 |
+
transform: translate(-50%, -50%);
|
40 |
+
background: rgba(0,0,0,0.8);
|
41 |
+
padding: 20px;
|
42 |
+
border-radius: 10px;
|
43 |
+
z-index: 2000;
|
44 |
+
text-align: center;
|
45 |
+
}
|
46 |
|
47 |
+
.loading-spinner {
|
48 |
+
width: 50px;
|
49 |
+
height: 50px;
|
50 |
+
border: 5px solid #0f0;
|
51 |
+
border-top: 5px solid transparent;
|
52 |
+
border-radius: 50%;
|
53 |
+
animation: spin 1s linear infinite;
|
54 |
+
margin: 0 auto 20px;
|
55 |
+
}
|
56 |
+
|
57 |
+
@keyframes spin {
|
58 |
+
0% { transform: rotate(0deg); }
|
59 |
+
100% { transform: rotate(360deg); }
|
60 |
+
}
|
61 |
+
|
62 |
+
.loading-text {
|
63 |
+
color: #0f0;
|
64 |
+
font-size: 24px;
|
65 |
+
text-align: center;
|
66 |
+
}
|
67 |
+
|
68 |
+
#gameContainer {
|
69 |
+
position: relative;
|
70 |
+
width: 100vw;
|
71 |
+
height: 100vh;
|
72 |
+
cursor: crosshair;
|
73 |
+
}
|
74 |
+
|
75 |
+
#info {
|
76 |
+
position: absolute;
|
77 |
+
top: 10px;
|
78 |
+
left: 10px;
|
79 |
+
color: #0f0;
|
80 |
+
background: rgba(0,20,0,0.7);
|
81 |
+
padding: 10px;
|
82 |
+
font-size: 14px;
|
83 |
+
z-index: 1001;
|
84 |
+
border: 1px solid #0f0;
|
85 |
+
border-radius: 5px;
|
86 |
+
user-select: none;
|
87 |
+
}
|
88 |
+
|
89 |
+
#crosshair {
|
90 |
+
position: fixed;
|
91 |
+
top: 25%;
|
92 |
+
left: 50%;
|
93 |
+
transform: translate(-50%, -50%);
|
94 |
+
width: 40px;
|
95 |
+
height: 40px;
|
96 |
+
border: 2px solid #00ff00;
|
97 |
+
border-radius: 50%;
|
98 |
+
z-index: 1001;
|
99 |
+
pointer-events: none;
|
100 |
+
transition: all 0.2s ease;
|
101 |
+
}
|
102 |
+
|
103 |
+
/* ๋ฌผ์ฒด๊ฐ ๊ฐ์ง๋์์ ๋์ ์คํ์ผ */
|
104 |
+
#crosshair.target-detected {
|
105 |
+
border-color: #ff0000;
|
106 |
+
border-width: 3px;
|
107 |
+
box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
|
108 |
+
}
|
109 |
+
|
110 |
+
#crosshair::before,
|
111 |
+
#crosshair::after {
|
112 |
+
content: '';
|
113 |
+
position: absolute;
|
114 |
+
background: #00ff00;
|
115 |
+
transition: all 0.2s ease;
|
116 |
+
}
|
117 |
+
|
118 |
+
#crosshair::before {
|
119 |
+
top: 50%;
|
120 |
+
left: -10px;
|
121 |
+
right: -10px;
|
122 |
+
height: 2px;
|
123 |
+
transform: translateY(-50%);
|
124 |
+
}
|
125 |
+
|
126 |
+
#crosshair::after {
|
127 |
+
left: 50%;
|
128 |
+
top: -10px;
|
129 |
+
bottom: -10px;
|
130 |
+
width: 2px;
|
131 |
+
transform: translateX(-50%);
|
132 |
+
}
|
133 |
+
|
134 |
+
/* ๋ฌผ์ฒด๊ฐ ๊ฐ์ง๋์์ ๋์ ํฌ๋ก์ค ๋ผ์ธ ์คํ์ผ */
|
135 |
+
#crosshair.target-detected::before,
|
136 |
+
#crosshair.target-detected::after {
|
137 |
+
background: #ff0000;
|
138 |
+
}
|
139 |
+
|
140 |
+
#healthBar {
|
141 |
+
position: absolute;
|
142 |
+
bottom: 20px;
|
143 |
+
left: 20px;
|
144 |
+
width: 200px;
|
145 |
+
height: 20px;
|
146 |
+
background: rgba(0,20,0,0.7);
|
147 |
+
border: 2px solid #0f0;
|
148 |
+
z-index: 1001;
|
149 |
+
border-radius: 10px;
|
150 |
+
overflow: hidden;
|
151 |
+
}
|
152 |
|
153 |
+
#health {
|
154 |
+
width: 100%;
|
155 |
+
height: 100%;
|
156 |
+
background: linear-gradient(90deg, #0f0, #00ff00);
|
157 |
+
transition: width 0.3s;
|
158 |
+
}
|
159 |
+
|
160 |
+
#ammo {
|
161 |
+
position: absolute;
|
162 |
+
bottom: 20px;
|
163 |
+
right: 20px;
|
164 |
+
color: #0f0;
|
165 |
+
background: rgba(0,20,0,0.7);
|
166 |
+
padding: 10px;
|
167 |
+
font-size: 20px;
|
168 |
+
z-index: 1001;
|
169 |
+
border: 1px solid #0f0;
|
170 |
+
border-radius: 5px;
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
#gameTitle {
|
175 |
+
position: absolute;
|
176 |
+
top: 10px;
|
177 |
+
left: 50%;
|
178 |
+
transform: translateX(-50%);
|
179 |
+
color: #0f0;
|
180 |
+
background: rgba(0,20,0,0.7);
|
181 |
+
padding: 10px 20px;
|
182 |
+
font-size: 20px;
|
183 |
+
z-index: 1001;
|
184 |
+
border: 1px solid #0f0;
|
185 |
+
border-radius: 5px;
|
186 |
+
text-transform: uppercase;
|
187 |
+
letter-spacing: 2px;
|
188 |
+
}
|
189 |
+
#ammoDisplay {
|
190 |
+
position: absolute;
|
191 |
+
bottom: 20px;
|
192 |
+
right: 20px;
|
193 |
+
color: #0f0;
|
194 |
+
background: rgba(0,20,0,0.7);
|
195 |
+
padding: 10px;
|
196 |
+
font-size: 20px;
|
197 |
+
z-index: 1001;
|
198 |
+
border: 1px solid #0f0;
|
199 |
+
border-radius: 5px;
|
200 |
+
}
|
201 |
+
|
202 |
+
#reloadingText {
|
203 |
+
position: absolute;
|
204 |
+
top: 50%;
|
205 |
+
left: 50%;
|
206 |
+
transform: translate(-50%, -50%);
|
207 |
+
color: #ff0000;
|
208 |
+
font-size: 24px;
|
209 |
+
font-weight: bold;
|
210 |
+
display: none;
|
211 |
+
z-index: 1002;
|
212 |
+
}
|
213 |
+
|
214 |
+
#radar {
|
215 |
+
position: absolute;
|
216 |
+
bottom: 60px; /* ์ฒด๋ ฅ๋ฐ ์๋ก ์ด๋ */
|
217 |
+
left: 20px;
|
218 |
+
width: 200px;
|
219 |
+
height: 200px;
|
220 |
+
background: rgba(0,20,0,0.3);
|
221 |
+
border: 2px solid #0f0;
|
222 |
+
border-radius: 50%;
|
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;
|
242 |
+
top: 50%;
|
243 |
+
left: 50%;
|
244 |
+
width: 50%;
|
245 |
+
height: 2px;
|
246 |
+
background: #0f0;
|
247 |
+
transform-origin: left center;
|
248 |
+
animation: radar-sweep 4s infinite linear;
|
249 |
+
}
|
250 |
+
|
251 |
+
.enemy-dot {
|
252 |
+
position: absolute;
|
253 |
+
width: 6px;
|
254 |
+
height: 6px;
|
255 |
+
background: #ff0000;
|
256 |
+
border-radius: 50%;
|
257 |
+
transform: translate(-50%, -50%);
|
258 |
+
}
|
259 |
+
|
260 |
+
@keyframes radar-sweep {
|
261 |
+
from {
|
262 |
+
transform: rotate(0deg);
|
263 |
+
}
|
264 |
+
to {
|
265 |
+
transform: rotate(360deg);
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
#gameStats {
|
270 |
+
position: absolute;
|
271 |
+
top: 10px;
|
272 |
+
right: 20px;
|
273 |
+
color: #0f0;
|
274 |
+
background: rgba(0,20,0,0.7);
|
275 |
+
padding: 10px;
|
276 |
+
font-size: 16px;
|
277 |
+
z-index: 1001;
|
278 |
+
border: 1px solid #0f0;
|
279 |
+
border-radius: 5px;
|
280 |
+
text-align: right;
|
281 |
+
}
|
282 |
+
|
283 |
+
.start-screen {
|
284 |
+
position: fixed;
|
285 |
+
top: 0;
|
286 |
+
left: 0;
|
287 |
+
width: 100%;
|
288 |
+
height: 100%;
|
289 |
+
background: rgba(0,0,0,0.8);
|
290 |
+
display: flex;
|
291 |
+
justify-content: center;
|
292 |
+
align-items: center;
|
293 |
+
flex-direction: column;
|
294 |
+
z-index: 2000;
|
295 |
+
}
|
296 |
+
|
297 |
+
.start-button {
|
298 |
+
padding: 15px 30px;
|
299 |
+
font-size: 24px;
|
300 |
+
background: #0f0;
|
301 |
+
color: #000;
|
302 |
+
border: none;
|
303 |
+
border-radius: 5px;
|
304 |
+
cursor: pointer;
|
305 |
+
margin-top: 20px;
|
306 |
+
transition: transform 0.2s;
|
307 |
+
}
|
308 |
+
|
309 |
+
.start-button:hover {
|
310 |
+
transform: scale(1.1);
|
311 |
+
}
|
312 |
+
|
313 |
+
#minimap {
|
314 |
+
position: absolute;
|
315 |
+
bottom: 20px;
|
316 |
+
right: 20px;
|
317 |
+
width: 200px;
|
318 |
+
height: 200px;
|
319 |
+
background: rgba(0,20,0,0.7);
|
320 |
+
border: 2px solid #0f0;
|
321 |
+
border-radius: 5px;
|
322 |
+
z-index: 1001;
|
323 |
+
}
|
324 |
+
</style>
|
325 |
+
</head>
|
326 |
<body>
|
327 |
+
<div id="loading">
|
328 |
+
<div class="loading-spinner"></div>
|
329 |
+
<div class="loading-text">Loading tank assets...</div>
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div class="start-screen" id="startScreen">
|
333 |
+
<h1 style="color: #0f0; font-size: 48px; margin-bottom: 20px;">Tank Combat Simulator</h1>
|
334 |
+
<button class="start-button" onclick="startGame()">Start Game</button>
|
335 |
+
<div style="color: #0f0; margin-top: 20px; text-align: center;">
|
336 |
+
<p>Controls:</p>
|
337 |
+
<p>W,A,S,D - Move Tank</p>
|
338 |
+
<p>Mouse - Look Around</p>
|
339 |
+
<p>Left Click - Fire</p>
|
340 |
+
<p>ESC - Pause</p>
|
341 |
+
</div>
|
342 |
+
</div>
|
343 |
|
344 |
+
|
345 |
+
<div id="gameContainer">
|
346 |
+
<div id="gameTitle">Tank Combat Simulator</div>
|
347 |
+
<div id="mission">MISSION: SURVIVE 180 SEC</div>
|
348 |
+
<div id="gameStats">
|
349 |
+
<div id="score">Score: 0</div>
|
350 |
+
<div id="time">Time: 180s</div>
|
351 |
+
</div>
|
352 |
+
<div id="crosshair"></div>
|
353 |
+
<div id="detected" style="position: absolute; top: 55%; left: 50%; transform: translate(-50%, -50%); color: red; font-size: 16px; display: none;">DETECTED</div>
|
354 |
+
<div id="enemyLabels"></div>
|
355 |
+
|
356 |
+
<!-- ์ฒด๋ ฅ๋ฐ -->
|
357 |
+
<div id="healthBar">
|
358 |
+
<div id="health"></div>
|
359 |
+
</div>
|
360 |
+
|
361 |
+
<!-- ์๋ก์ด ํ์ฝ ์์คํ
-->
|
362 |
+
<div id="ammoDisplay">APFSDS: 1/1</div>
|
363 |
+
|
364 |
+
<!-- ๋ฆฌ๋ก๋ฉ ํ
์คํธ -->
|
365 |
+
<div id="reloadingText">RELOADING...</div>
|
366 |
+
|
367 |
+
<!-- ๋ ์ด๋ -->
|
368 |
+
<div id="radar">
|
369 |
+
<div id="radarLine"></div>
|
370 |
+
</div>
|
371 |
+
</div>
|
372 |
+
|
373 |
+
<script type="importmap">
|
374 |
+
{
|
375 |
+
"imports": {
|
376 |
+
"three": "https://unpkg.com/[email protected]/build/three.module.js",
|
377 |
+
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
|
378 |
+
}
|
379 |
+
}
|
380 |
+
</script>
|
381 |
+
<script>
|
382 |
+
function startGame() {
|
383 |
+
document.getElementById('startScreen').style.display = 'none';
|
384 |
+
// ์ฌ๊ธฐ์ ๊ฒ์ ์์ ๋ก์ง ์ถ๊ฐ
|
385 |
+
document.body.requestPointerLock();
|
386 |
+
}
|
387 |
+
|
388 |
+
// ํฌ์ธํฐ ๋ฝ ์ด๋ฒคํธ ์ฒ๋ฆฌ
|
389 |
+
document.addEventListener('pointerlockchange', () => {
|
390 |
+
if (document.pointerLockElement === document.body) {
|
391 |
+
console.log('Pointer locked');
|
392 |
+
} else {
|
393 |
+
console.log('Pointer unlocked');
|
394 |
+
}
|
395 |
+
});
|
396 |
+
</script>
|
397 |
+
<script type="module" src="game.js"></script>
|
398 |
+
</body>
|
399 |
</html>
|