Spaces:
Running
Running
Update index.html
Browse files- index.html +108 -18
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Tank Combat Simulator</title>
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
margin: 0;
|
|
@@ -45,6 +45,13 @@
|
|
| 45 |
text-align: center;
|
| 46 |
}
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
#info {
|
| 49 |
position: absolute;
|
| 50 |
top: 10px;
|
|
@@ -70,6 +77,7 @@
|
|
| 70 |
border-radius: 50%;
|
| 71 |
z-index: 1001;
|
| 72 |
pointer-events: none;
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
#crosshair::before,
|
|
@@ -141,19 +149,76 @@
|
|
| 141 |
border-radius: 5px;
|
| 142 |
}
|
| 143 |
|
| 144 |
-
#
|
| 145 |
position: absolute;
|
| 146 |
top: 10px;
|
| 147 |
left: 50%;
|
| 148 |
transform: translateX(-50%);
|
| 149 |
color: #0f0;
|
| 150 |
background: rgba(0,20,0,0.7);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
padding: 10px;
|
| 152 |
-
font-size:
|
| 153 |
z-index: 1001;
|
| 154 |
border: 1px solid #0f0;
|
| 155 |
border-radius: 5px;
|
| 156 |
-
text-align:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
}
|
| 158 |
</style>
|
| 159 |
</head>
|
|
@@ -162,23 +227,32 @@
|
|
| 162 |
<div class="loading-spinner"></div>
|
| 163 |
<div class="loading-text">Loading tank assets...</div>
|
| 164 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
-
<div id="
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
| 174 |
</div>
|
| 175 |
|
| 176 |
-
<div id="controls">Tank Combat Simulator</div>
|
| 177 |
-
<div id="crosshair"></div>
|
| 178 |
-
<div id="healthBar"><div id="health"></div></div>
|
| 179 |
-
<div id="ammo">Ammo: 10/10</div>
|
| 180 |
-
<div id="turretInfo">Turret Angle: 0°</div>
|
| 181 |
-
|
| 182 |
<script type="importmap">
|
| 183 |
{
|
| 184 |
"imports": {
|
|
@@ -187,6 +261,22 @@
|
|
| 187 |
}
|
| 188 |
}
|
| 189 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
<script type="module" src="game.js"></script>
|
| 191 |
</body>
|
| 192 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Tank Combat Simulator - FPS Mode</title>
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
margin: 0;
|
|
|
|
| 45 |
text-align: center;
|
| 46 |
}
|
| 47 |
|
| 48 |
+
#gameContainer {
|
| 49 |
+
position: relative;
|
| 50 |
+
width: 100vw;
|
| 51 |
+
height: 100vh;
|
| 52 |
+
cursor: crosshair;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
#info {
|
| 56 |
position: absolute;
|
| 57 |
top: 10px;
|
|
|
|
| 77 |
border-radius: 50%;
|
| 78 |
z-index: 1001;
|
| 79 |
pointer-events: none;
|
| 80 |
+
mix-blend-mode: difference;
|
| 81 |
}
|
| 82 |
|
| 83 |
#crosshair::before,
|
|
|
|
| 149 |
border-radius: 5px;
|
| 150 |
}
|
| 151 |
|
| 152 |
+
#gameTitle {
|
| 153 |
position: absolute;
|
| 154 |
top: 10px;
|
| 155 |
left: 50%;
|
| 156 |
transform: translateX(-50%);
|
| 157 |
color: #0f0;
|
| 158 |
background: rgba(0,20,0,0.7);
|
| 159 |
+
padding: 10px 20px;
|
| 160 |
+
font-size: 20px;
|
| 161 |
+
z-index: 1001;
|
| 162 |
+
border: 1px solid #0f0;
|
| 163 |
+
border-radius: 5px;
|
| 164 |
+
text-transform: uppercase;
|
| 165 |
+
letter-spacing: 2px;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
#gameStats {
|
| 169 |
+
position: absolute;
|
| 170 |
+
top: 10px;
|
| 171 |
+
right: 20px;
|
| 172 |
+
color: #0f0;
|
| 173 |
+
background: rgba(0,20,0,0.7);
|
| 174 |
padding: 10px;
|
| 175 |
+
font-size: 16px;
|
| 176 |
z-index: 1001;
|
| 177 |
border: 1px solid #0f0;
|
| 178 |
border-radius: 5px;
|
| 179 |
+
text-align: right;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
.start-screen {
|
| 183 |
+
position: fixed;
|
| 184 |
+
top: 0;
|
| 185 |
+
left: 0;
|
| 186 |
+
width: 100%;
|
| 187 |
+
height: 100%;
|
| 188 |
+
background: rgba(0,0,0,0.8);
|
| 189 |
+
display: flex;
|
| 190 |
+
justify-content: center;
|
| 191 |
+
align-items: center;
|
| 192 |
+
flex-direction: column;
|
| 193 |
+
z-index: 2000;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.start-button {
|
| 197 |
+
padding: 15px 30px;
|
| 198 |
+
font-size: 24px;
|
| 199 |
+
background: #0f0;
|
| 200 |
+
color: #000;
|
| 201 |
+
border: none;
|
| 202 |
+
border-radius: 5px;
|
| 203 |
+
cursor: pointer;
|
| 204 |
+
margin-top: 20px;
|
| 205 |
+
transition: transform 0.2s;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.start-button:hover {
|
| 209 |
+
transform: scale(1.1);
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
#minimap {
|
| 213 |
+
position: absolute;
|
| 214 |
+
bottom: 20px;
|
| 215 |
+
right: 20px;
|
| 216 |
+
width: 200px;
|
| 217 |
+
height: 200px;
|
| 218 |
+
background: rgba(0,20,0,0.7);
|
| 219 |
+
border: 2px solid #0f0;
|
| 220 |
+
border-radius: 5px;
|
| 221 |
+
z-index: 1001;
|
| 222 |
}
|
| 223 |
</style>
|
| 224 |
</head>
|
|
|
|
| 227 |
<div class="loading-spinner"></div>
|
| 228 |
<div class="loading-text">Loading tank assets...</div>
|
| 229 |
</div>
|
| 230 |
+
|
| 231 |
+
<div class="start-screen" id="startScreen">
|
| 232 |
+
<h1 style="color: #0f0; font-size: 48px; margin-bottom: 20px;">Tank Combat Simulator</h1>
|
| 233 |
+
<button class="start-button" onclick="startGame()">Start Game</button>
|
| 234 |
+
<div style="color: #0f0; margin-top: 20px; text-align: center;">
|
| 235 |
+
<p>Controls:</p>
|
| 236 |
+
<p>W,A,S,D - Move Tank</p>
|
| 237 |
+
<p>Mouse - Look Around</p>
|
| 238 |
+
<p>Left Click - Fire</p>
|
| 239 |
+
<p>ESC - Pause</p>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
|
| 243 |
+
<div id="gameContainer">
|
| 244 |
+
<div id="gameTitle">Tank Combat Simulator</div>
|
| 245 |
+
<div id="gameStats">
|
| 246 |
+
<div id="score">Score: 0</div>
|
| 247 |
+
<div id="time">Time: 180s</div>
|
| 248 |
+
</div>
|
| 249 |
+
<div id="crosshair"></div>
|
| 250 |
+
<div id="healthBar"><div id="health"></div></div>
|
| 251 |
+
<div id="ammo">Ammo: 10/10</div>
|
| 252 |
+
<div id="turretInfo">Turret Angle: 0°</div>
|
| 253 |
+
<div id="minimap"></div>
|
| 254 |
</div>
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
<script type="importmap">
|
| 257 |
{
|
| 258 |
"imports": {
|
|
|
|
| 261 |
}
|
| 262 |
}
|
| 263 |
</script>
|
| 264 |
+
<script>
|
| 265 |
+
function startGame() {
|
| 266 |
+
document.getElementById('startScreen').style.display = 'none';
|
| 267 |
+
// 여기에 게임 시작 로직 추가
|
| 268 |
+
document.body.requestPointerLock();
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
// 포인터 락 이벤트 처리
|
| 272 |
+
document.addEventListener('pointerlockchange', () => {
|
| 273 |
+
if (document.pointerLockElement === document.body) {
|
| 274 |
+
console.log('Pointer locked');
|
| 275 |
+
} else {
|
| 276 |
+
console.log('Pointer unlocked');
|
| 277 |
+
}
|
| 278 |
+
});
|
| 279 |
+
</script>
|
| 280 |
<script type="module" src="game.js"></script>
|
| 281 |
</body>
|
| 282 |
</html>
|