Spaces:
Running
Running
Update index.html
Browse files- index.html +34 -32
index.html
CHANGED
@@ -191,33 +191,33 @@
|
|
191 |
}
|
192 |
|
193 |
class Enemy {
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
|
222 |
update() {
|
223 |
if(isCountingDown) return;
|
@@ -239,8 +239,10 @@
|
|
239 |
}
|
240 |
}
|
241 |
|
242 |
-
|
243 |
-
|
|
|
|
|
244 |
bullets.push({
|
245 |
x: this.x + Math.cos(this.angle) * 30,
|
246 |
y: this.y + Math.sin(this.angle) * 30,
|
@@ -248,7 +250,7 @@
|
|
248 |
speed: 5,
|
249 |
isEnemy: true,
|
250 |
size: this.isBoss ? 5 : 3,
|
251 |
-
damage: this.isBoss ?
|
252 |
});
|
253 |
}
|
254 |
}
|
@@ -274,8 +276,8 @@ function buyTank(tankImg, cost, tankId) {
|
|
274 |
if (tankId === 'tank1') { // PZ.IV
|
275 |
player.maxHealth = 1500;
|
276 |
player.speed = defaultPlayerStats.speed; // 기본 이동속도로 복구
|
277 |
-
player.width =
|
278 |
-
player.height =
|
279 |
}
|
280 |
else if (tankId === 'tank2') { // TIGER
|
281 |
player.maxHealth = 2000;
|
|
|
191 |
}
|
192 |
|
193 |
class Enemy {
|
194 |
+
constructor(isBoss = false) {
|
195 |
+
this.x = Math.random() * canvas.width;
|
196 |
+
this.y = Math.random() * canvas.height;
|
197 |
+
this.health = isBoss ? 10000 : 1000; // 보스 체력 2배
|
198 |
+
this.maxHealth = this.health;
|
199 |
+
this.speed = isBoss ? 1 : 2;
|
200 |
+
this.lastShot = 0;
|
201 |
+
this.shootInterval = isBoss ? 1000 : 1000;
|
202 |
+
this.angle = 0;
|
203 |
+
this.width = 100;
|
204 |
+
this.height = 45;
|
205 |
+
this.moveTimer = 0;
|
206 |
+
this.moveInterval = Math.random() * 2000 + 1000;
|
207 |
+
this.moveAngle = Math.random() * Math.PI * 2;
|
208 |
+
this.isBoss = isBoss;
|
209 |
+
|
210 |
+
if (isBoss) {
|
211 |
+
this.enemyImg = new Image();
|
212 |
+
this.enemyImg.src = 'boss.png';
|
213 |
+
} else if (currentRound >= 7) {
|
214 |
+
this.enemyImg = new Image();
|
215 |
+
this.enemyImg.src = 'enemy3.png';
|
216 |
+
} else if (currentRound >= 4) {
|
217 |
+
this.enemyImg = new Image();
|
218 |
+
this.enemyImg.src = 'enemy2.png';
|
219 |
+
}
|
220 |
+
}
|
221 |
|
222 |
update() {
|
223 |
if(isCountingDown) return;
|
|
|
239 |
}
|
240 |
}
|
241 |
|
242 |
+
shoot() {
|
243 |
+
const sound = this.isBoss ? new Audio('firemn.ogg') : enemyFireSound.cloneNode();
|
244 |
+
sound.play();
|
245 |
+
|
246 |
bullets.push({
|
247 |
x: this.x + Math.cos(this.angle) * 30,
|
248 |
y: this.y + Math.sin(this.angle) * 30,
|
|
|
250 |
speed: 5,
|
251 |
isEnemy: true,
|
252 |
size: this.isBoss ? 5 : 3,
|
253 |
+
damage: this.isBoss ? 300 : 150 // 보스 200 -> 300, 일반 적 100 -> 150으로 강화
|
254 |
});
|
255 |
}
|
256 |
}
|
|
|
276 |
if (tankId === 'tank1') { // PZ.IV
|
277 |
player.maxHealth = 1500;
|
278 |
player.speed = defaultPlayerStats.speed; // 기본 이동속도로 복구
|
279 |
+
player.width = 95; // PZ.IV의 크기 설정
|
280 |
+
player.height = 50; // PZ.IV의 크기 설정
|
281 |
}
|
282 |
else if (tankId === 'tank2') { // TIGER
|
283 |
player.maxHealth = 2000;
|