Spaces:
Running
Running
cutechicken
commited on
Update index.html
Browse files- index.html +16 -12
index.html
CHANGED
@@ -248,7 +248,9 @@
|
|
248 |
// 플레이어의 기본 상태를 저장
|
249 |
const defaultPlayerStats = {
|
250 |
maxHealth: 1000,
|
251 |
-
speed: 5
|
|
|
|
|
252 |
};
|
253 |
function buyTank(tankImg, cost, tankId) {
|
254 |
if (gold >= cost) {
|
@@ -256,18 +258,20 @@ function buyTank(tankImg, cost, tankId) {
|
|
256 |
playerImg.src = tankImg;
|
257 |
document.getElementById(tankId).style.display = 'none';
|
258 |
document.getElementById('shop').style.display = 'none';
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
player.
|
265 |
-
}
|
266 |
-
if (
|
267 |
-
player.maxHealth
|
268 |
-
player.speed
|
|
|
|
|
269 |
}
|
270 |
-
|
271 |
player.health = player.maxHealth;
|
272 |
}
|
273 |
}
|
|
|
248 |
// 플레이어의 기본 상태를 저장
|
249 |
const defaultPlayerStats = {
|
250 |
maxHealth: 1000,
|
251 |
+
speed: 5,
|
252 |
+
width: 100,
|
253 |
+
height: 45
|
254 |
};
|
255 |
function buyTank(tankImg, cost, tankId) {
|
256 |
if (gold >= cost) {
|
|
|
258 |
playerImg.src = tankImg;
|
259 |
document.getElementById(tankId).style.display = 'none';
|
260 |
document.getElementById('shop').style.display = 'none';
|
261 |
+
|
262 |
+
if (tankId === 'tank1') { // PZ.IV
|
263 |
+
player.maxHealth = 1500;
|
264 |
+
player.speed = defaultPlayerStats.speed; // 기본 이동속도로 복구
|
265 |
+
player.width = 95; // PZ.IV의 크기 설정
|
266 |
+
player.height = 55; // PZ.IV의 크기 설정
|
267 |
+
}
|
268 |
+
else if (tankId === 'tank2') { // TIGER
|
269 |
+
player.maxHealth = 2000;
|
270 |
+
player.speed = defaultPlayerStats.speed * 0.7;
|
271 |
+
player.width = 100; // TIGER는 기본 크기 유지
|
272 |
+
player.height = 45; // TIGER는 기본 크기 유지
|
273 |
}
|
274 |
+
|
275 |
player.health = player.maxHealth;
|
276 |
}
|
277 |
}
|