cutechicken commited on
Commit
1ddb05f
ยท
verified ยท
1 Parent(s): 90babb0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +18 -16
index.html CHANGED
@@ -327,28 +327,30 @@
327
  shoot() {
328
  if (!this.hasPlayedMGSound) {
329
  const mgSound = new Audio('ju87mg.ogg');
330
- mgSound.volume = 1.0; // ๋ณผ๋ฅจ์„ ์ตœ๋Œ€๋กœ ์„ค์ •
331
  mgSound.currentTime = 0;
332
  mgSound.play().catch(error => console.error('Audio play failed:', error));
333
  this.hasPlayedMGSound = true;
334
  }
335
 
336
- [[59, 36], [59, 62]].forEach(([x, y]) => {
337
- const rotatedX = this.x + (Math.cos(this.angle) * x - Math.sin(this.angle) * y);
338
- const rotatedY = this.y + (Math.sin(this.angle) * x + Math.cos(this.angle) * y);
339
-
340
- bullets.push({
341
- x: rotatedX,
342
- y: rotatedY,
343
- angle: this.angle,
344
- speed: 10,
345
- isEnemy: false,
346
- damage: weapons.machinegun.damage,
347
- size: weapons.machinegun.bulletSize
348
- });
349
- });
350
- }
351
 
 
 
 
 
 
 
 
 
 
 
 
352
  update() {
353
  if (!this.hasPlayedSound) {
354
  const sirenSound = new Audio('ju87siren.ogg');
 
327
  shoot() {
328
  if (!this.hasPlayedMGSound) {
329
  const mgSound = new Audio('ju87mg.ogg');
330
+ mgSound.volume = 1.0;
331
  mgSound.currentTime = 0;
332
  mgSound.play().catch(error => console.error('Audio play failed:', error));
333
  this.hasPlayedMGSound = true;
334
  }
335
 
336
+ // ๊ธฐ๊ด€์ด ์œ„์น˜๋ฅผ ์ค‘์•™ ๊ธฐ์ค€์œผ๋กœ ์ขŒ์šฐ ๋Œ€์นญ์œผ๋กœ ๋ณ€๊ฒฝ
337
+ // ์ค‘์•™์—์„œ ์ขŒ์šฐ 15ํ”ฝ์…€ ๋–จ์–ด์ง„ ์œ„์น˜์—์„œ ๋ฐœ์‚ฌ
338
+ [[-15, 0], [15, 0]].forEach(([offsetX, offsetY]) => {
339
+ // ํšŒ์ „ ๋ณ€ํ™˜ ์ ์šฉ
340
+ const rotatedX = this.x + (Math.cos(this.angle) * offsetX - Math.sin(this.angle) * offsetY);
341
+ const rotatedY = this.y + (Math.sin(this.angle) * offsetX + Math.cos(this.angle) * offsetY);
 
 
 
 
 
 
 
 
 
342
 
343
+ bullets.push({
344
+ x: rotatedX,
345
+ y: rotatedY,
346
+ angle: this.angle,
347
+ speed: 10,
348
+ isEnemy: false,
349
+ damage: weapons.machinegun.damage * 2,
350
+ size: weapons.machinegun.bulletSize
351
+ });
352
+ });
353
+ }
354
  update() {
355
  if (!this.hasPlayedSound) {
356
  const sirenSound = new Audio('ju87siren.ogg');