Spaces:
Running
Running
Update index.html
Browse files- index.html +3 -2
index.html
CHANGED
@@ -201,7 +201,7 @@
|
|
201 |
constructor(isBoss = false) {
|
202 |
this.x = Math.random() * canvas.width;
|
203 |
this.y = Math.random() * canvas.height;
|
204 |
-
this.health = isBoss ?
|
205 |
this.maxHealth = this.health;
|
206 |
this.speed = isBoss ? 1 : 2;
|
207 |
this.lastShot = 0;
|
@@ -365,7 +365,8 @@ function buyTank(tankImg, cost, tankId) {
|
|
365 |
enemies = enemies.filter(enemy => {
|
366 |
const dist = Math.hypot(bullet.x - enemy.x, bullet.y - enemy.y);
|
367 |
if(dist < 30) {
|
368 |
-
|
|
|
369 |
if(enemy.health <= 0) {
|
370 |
spawnHealthItem(enemy.x, enemy.y);
|
371 |
gold += 100;
|
|
|
201 |
constructor(isBoss = false) {
|
202 |
this.x = Math.random() * canvas.width;
|
203 |
this.y = Math.random() * canvas.height;
|
204 |
+
this.health = isBoss ? 4000 : 1000;
|
205 |
this.maxHealth = this.health;
|
206 |
this.speed = isBoss ? 1 : 2;
|
207 |
this.lastShot = 0;
|
|
|
365 |
enemies = enemies.filter(enemy => {
|
366 |
const dist = Math.hypot(bullet.x - enemy.x, bullet.y - enemy.y);
|
367 |
if(dist < 30) {
|
368 |
+
let damage = currentWeapon === 'cannon' ? 250 : 50; // 고정 데미지로 변경
|
369 |
+
enemy.health -= damage;
|
370 |
if(enemy.health <= 0) {
|
371 |
spawnHealthItem(enemy.x, enemy.y);
|
372 |
gold += 100;
|