ProPerNounpYK commited on
Commit
0c9d2df
·
verified ·
1 Parent(s): 065c478

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +14 -19
index.html CHANGED
@@ -320,25 +320,20 @@ if (enemiesRemaining <= 0 && enemies.length === 0) {
320
  if (player.x < canvas.width - player.width) player.x += player.speed;
321
  break;
322
  case ' ':
323
- if (player.bullets > 0) {
324
- const shootImage = player.direction === 1 ? imageShootRight : imageShootLeft;
325
- player.image.src = shootImage; // 발사 이미지로 변경
326
- setTimeout(() => {
327
- player.image.src = player.direction === 1 ? player.imageRight : player.imageLeft; // 1초 후 기본 이미지로 복원
328
- }, 1000);
329
-
330
- bullets.push({
331
- x: player.x + player.width / 2,
332
- y: player.y + player.height / 2.5,
333
- width: 10,
334
- height: 5,
335
- speed: player.direction * 10
336
- });
337
- player.bullets--;
338
- bulletCount.textContent = player.bullets;
339
- playerShootSound.play();
340
- }
341
- break;
342
  }
343
  }
344
  });
 
320
  if (player.x < canvas.width - player.width) player.x += player.speed;
321
  break;
322
  case ' ':
323
+ if (player.bullets > 0) {
324
+ player.image.src = player.direction === 1 ? player.imageShootRight : player.imageShootLeft;
325
+ bullets.push({
326
+ x: player.x + player.width / 2,
327
+ y: player.y + player.height / 2.5,
328
+ width: 10,
329
+ height: 5,
330
+ speed: player.direction * 10
331
+ });
332
+ player.bullets--;
333
+ bulletCount.textContent = player.bullets;
334
+ playerShootSound.play();
335
+ }
336
+ break;
 
 
 
 
 
337
  }
338
  }
339
  });