cutechicken commited on
Commit
f67994b
ยท
verified ยท
1 Parent(s): 1ec6ab1

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +22 -7
index.html CHANGED
@@ -255,7 +255,7 @@
255
  return Date.now() - this.startTime > this.duration;
256
  }
257
  }
258
- class SupportUnit {
259
  constructor(yPosition) {
260
  this.x = 0;
261
  this.y = yPosition;
@@ -267,14 +267,25 @@
267
  this.img = new Image();
268
  this.img.src = 'bf109.png';
269
  this.hasPlayedSound = false; // ์ฒซ ๋“ฑ์žฅ ์†Œ๋ฆฌ์šฉ
 
270
  }
271
 
272
  update() {
273
  // ์ด๋™
274
  this.x += this.speed;
 
 
 
 
 
 
 
 
 
 
275
  // ๋ฐœ์‚ฌ (1์ดˆ์— 5๋ฐœ)
276
  const now = Date.now();
277
- if (now - this.lastShot > 200) {
278
  this.shoot();
279
  this.lastShot = now;
280
  }
@@ -282,15 +293,19 @@
282
  }
283
 
284
  shoot() {
285
- // ์ตœ์ดˆ ๋“ฑ์žฅ์‹œ bf109mg.ogg ์žฌ์ƒ
286
- if (!this.hasPlayedSound && !isCountingDown) {
287
- new Audio('bf109mg.ogg').play();
 
 
288
  this.hasPlayedSound = true;
289
  }
290
 
291
- // ๋งค ๋ฐœ์‚ฌ์‹œ bf109mgse.ogg ์žฌ์ƒ (์นด์šดํŠธ๋‹ค์šด ์ค‘์ด ์•„๋‹ ๋•Œ๋งŒ)
292
  if (!isCountingDown) {
293
- new Audio('bf109mgse.ogg').play();
 
 
294
  }
295
 
296
  bullets.push({
 
255
  return Date.now() - this.startTime > this.duration;
256
  }
257
  }
258
+ class SupportUnit {
259
  constructor(yPosition) {
260
  this.x = 0;
261
  this.y = yPosition;
 
267
  this.img = new Image();
268
  this.img.src = 'bf109.png';
269
  this.hasPlayedSound = false; // ์ฒซ ๋“ฑ์žฅ ์†Œ๋ฆฌ์šฉ
270
+ this.mgSound = null; // ๊ธฐ๊ด€์ด ์†Œ๋ฆฌ ๊ฐ์ฒด
271
  }
272
 
273
  update() {
274
  // ์ด๋™
275
  this.x += this.speed;
276
+
277
+ // ์นด์šดํŠธ๋‹ค์šด ์ค‘์ด๋ฉด ์†Œ๋ฆฌ ์ •์ง€ ๋ฐ ์ดˆ๊ธฐํ™”
278
+ if (isCountingDown) {
279
+ if (this.mgSound) {
280
+ this.mgSound.pause();
281
+ this.mgSound.currentTime = 0;
282
+ }
283
+ this.hasPlayedSound = false;
284
+ }
285
+
286
  // ๋ฐœ์‚ฌ (1์ดˆ์— 5๋ฐœ)
287
  const now = Date.now();
288
+ if (now - this.lastShot > 200 && !isCountingDown) {
289
  this.shoot();
290
  this.lastShot = now;
291
  }
 
293
  }
294
 
295
  shoot() {
296
+ // ์ตœ์ดˆ ๋“ฑ์žฅ์‹œ์—๋งŒ bf109mg.ogg ์žฌ์ƒ
297
+ if (!this.hasPlayedSound) {
298
+ const firstSound = new Audio('bf109mg.ogg');
299
+ firstSound.volume = 0.5;
300
+ firstSound.play();
301
  this.hasPlayedSound = true;
302
  }
303
 
304
+ // ๋ฐœ์‚ฌํ•  ๋•Œ๋งˆ๋‹ค ์ƒˆ๋กœ์šด bf109mgse.ogg ์žฌ์ƒ
305
  if (!isCountingDown) {
306
+ const shootSound = new Audio('bf109mgse.ogg');
307
+ shootSound.volume = 0.3; // ๋ณผ๋ฅจ ๋‚ฎ์ถค
308
+ shootSound.play();
309
  }
310
 
311
  bullets.push({