cutechicken commited on
Commit
ccce888
·
verified ·
1 Parent(s): 103f687

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +41 -38
index.html CHANGED
@@ -184,32 +184,33 @@
184
  }, 1000);
185
  }
186
  class Enemy {
187
- constructor(isBoss = false) {
188
- this.x = Math.random() * canvas.width;
189
- this.y = Math.random() * canvas.height;
190
- this.health = isBoss ? 5000 : 1000;
191
- this.maxHealth = this.health;
192
- this.speed = isBoss ? 1 : 2;
193
- this.lastShot = 0;
194
- this.shootInterval = isBoss ? 1000 : 1000;
195
- this.angle = 0;
196
- this.width = 100;
197
- this.height = 45;
198
- this.moveTimer = 0;
199
- this.moveInterval = Math.random() * 2000 + 1000;
200
- this.moveAngle = Math.random() * Math.PI * 2;
201
- this.isBoss = isBoss;
202
- if (isBoss) {
203
- this.enemyImg = new Image();
204
- this.enemyImg.src = 'boss.png';
205
- } else if (currentRound >= 7) {
206
- this.enemyImg = new Image();
207
- this.enemyImg.src = 'enemy3.png';
208
- } else if (currentRound >= 4) {
209
- this.enemyImg = new Image();
210
- this.enemyImg.src = 'enemy2.png';
211
- }
212
- }
 
213
  update() {
214
  if(isCountingDown) return;
215
  const now = Date.now();
@@ -229,18 +230,20 @@
229
  this.lastShot = now;
230
  }
231
  }
232
- shoot() {
233
- enemyFireSound.cloneNode().play();
234
- bullets.push({
235
- x: this.x + Math.cos(this.angle) * 30,
236
- y: this.y + Math.sin(this.angle) * 30,
237
- angle: this.angle,
238
- speed: 5,
239
- isEnemy: true,
240
- size: this.isBoss ? 5 : 3,
241
- damage: this.isBoss ? 200 : 100
242
- });
243
- }
 
 
244
  }
245
  function showShop() {
246
  document.getElementById('shop').style.display = 'block';
 
184
  }, 1000);
185
  }
186
  class Enemy {
187
+ constructor(isBoss = false) {
188
+ this.x = Math.random() * canvas.width;
189
+ this.y = Math.random() * canvas.height;
190
+ this.health = isBoss ? 10000 : 1000; // 보스 체력 2배
191
+ this.maxHealth = this.health;
192
+ this.speed = isBoss ? 1 : 2;
193
+ this.lastShot = 0;
194
+ this.shootInterval = isBoss ? 1000 : 1000;
195
+ this.angle = 0;
196
+ this.width = 100;
197
+ this.height = 45;
198
+ this.moveTimer = 0;
199
+ this.moveInterval = Math.random() * 2000 + 1000;
200
+ this.moveAngle = Math.random() * Math.PI * 2;
201
+ this.isBoss = isBoss;
202
+
203
+ if (isBoss) {
204
+ this.enemyImg = new Image();
205
+ this.enemyImg.src = 'boss.png';
206
+ } else if (currentRound >= 7) {
207
+ this.enemyImg = new Image();
208
+ this.enemyImg.src = 'enemy3.png';
209
+ } else if (currentRound >= 4) {
210
+ this.enemyImg = new Image();
211
+ this.enemyImg.src = 'enemy2.png';
212
+ }
213
+ }
214
  update() {
215
  if(isCountingDown) return;
216
  const now = Date.now();
 
230
  this.lastShot = now;
231
  }
232
  }
233
+ shoot() {
234
+ const sound = this.isBoss ? new Audio('firemn.ogg') : enemyFireSound.cloneNode();
235
+ sound.play();
236
+
237
+ bullets.push({
238
+ x: this.x + Math.cos(this.angle) * 30,
239
+ y: this.y + Math.sin(this.angle) * 30,
240
+ angle: this.angle,
241
+ speed: 5,
242
+ isEnemy: true,
243
+ size: this.isBoss ? 5 : 3,
244
+ damage: this.isBoss ? 300 : 150 // 보스 200 -> 300, 일반 적 100 -> 150으로 강화
245
+ });
246
+ }
247
  }
248
  function showShop() {
249
  document.getElementById('shop').style.display = 'block';