cutechicken commited on
Commit
7198353
ยท
verified ยท
1 Parent(s): 444aef9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +8 -12
index.html CHANGED
@@ -262,7 +262,6 @@ const defaultPlayerStats = {
262
  maxHealth: 1000,
263
  speed: 5
264
  };
265
-
266
  function buyTank(tankImg, cost, tankId) {
267
  if (gold >= cost) {
268
  gold -= cost;
@@ -270,17 +269,14 @@ function buyTank(tankImg, cost, tankId) {
270
  document.getElementById(tankId).style.display = 'none';
271
  document.getElementById('shop').style.display = 'none';
272
 
273
- // ๋จผ์ € ํ”Œ๋ ˆ์ด์–ด ์Šคํƒฏ์„ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”
274
- player.maxHealth = defaultPlayerStats.maxHealth;
275
- player.speed = defaultPlayerStats.speed;
276
-
277
- // ๊ตฌ๋งคํ•œ ๋ชจ๋“  ์ „์ฐจ์˜ ํšจ๊ณผ๋ฅผ ํ•œ ๋ฒˆ์— ์ ์šฉ
278
- if (document.getElementById('tank1').style.display === 'none') { // PZ.IV ๊ตฌ๋งค ์—ฌ๋ถ€
279
- player.maxHealth += 500;
280
- }
281
- if (document.getElementById('tank2').style.display === 'none') { // TIGER ๊ตฌ๋งค ์—ฌ๋ถ€
282
- player.maxHealth += 1000;
283
- player.speed *= 0.7;
284
  }
285
 
286
  // ํ˜„์žฌ ์ฒด๋ ฅ์„ ์ƒˆ๋กœ์šด ์ตœ๋Œ€ ์ฒด๋ ฅ์œผ๋กœ ์„ค์ •
 
262
  maxHealth: 1000,
263
  speed: 5
264
  };
 
265
  function buyTank(tankImg, cost, tankId) {
266
  if (gold >= cost) {
267
  gold -= cost;
 
269
  document.getElementById(tankId).style.display = 'none';
270
  document.getElementById('shop').style.display = 'none';
271
 
272
+ // ๊ฐ ์ „์ฐจ ํƒ€์ž…์— ๋”ฐ๋ผ ์Šคํƒฏ ์ง์ ‘ ์„ค์ •
273
+ if (tankId === 'tank1') { // PZ.IV
274
+ player.maxHealth = 1500;
275
+ player.speed = defaultPlayerStats.speed; // ๊ธฐ๋ณธ ์ด๋™์†๋„๋กœ ๋ณต๊ตฌ
276
+ }
277
+ else if (tankId === 'tank2') { // TIGER
278
+ player.maxHealth = 2000;
279
+ player.speed = defaultPlayerStats.speed * 0.7; // ์ƒˆ๋กœ์šด ์†๋„ ๊ณ„์‚ฐ
 
 
 
280
  }
281
 
282
  // ํ˜„์žฌ ์ฒด๋ ฅ์„ ์ƒˆ๋กœ์šด ์ตœ๋Œ€ ์ฒด๋ ฅ์œผ๋กœ ์„ค์ •