cutechicken commited on
Commit
0f7399b
Β·
verified Β·
1 Parent(s): 66f04c8

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +30 -12
index.html CHANGED
@@ -315,6 +315,7 @@
315
  this.hasPlayedSound = false;
316
  this.hasPlayedMGSound = false;
317
  this.isReturning = false;
 
318
  }
319
 
320
  selectTarget() {
@@ -360,7 +361,6 @@
360
  if (!this.isReturning) {
361
  this.isReturning = true;
362
  this.target = null;
363
- // μ€‘μ•™μœΌλ‘œ 이동
364
  this.angle = Math.atan2(canvas.height/2 - this.y, canvas.width/2 - this.x);
365
  } else {
366
  this.angle = Math.PI;
@@ -380,6 +380,17 @@
380
  if (this.target) {
381
  this.angle = Math.atan2(this.target.y - this.y, this.target.x - this.x);
382
  }
 
 
 
 
 
 
 
 
 
 
 
383
  }
384
  }
385
 
@@ -529,18 +540,25 @@ function buyTank(tankImg, cost, tankId) {
529
  lastJU87Spawn = Date.now(); // ꡬ맀 μ¦‰μ‹œ 슀폰 타이머 μ΄ˆκΈ°ν™”
530
  }
531
  }
532
- function initRound() {
533
- enemies = [];
534
- for(let i = 0; i < 1 * currentRound; i++) {
535
- enemies.push(new Enemy());
536
- }
537
- player.health = player.maxHealth;
538
- bullets = [];
539
- items = [];
540
- supportUnits = []; // 지원 μœ λ‹› μ΄ˆκΈ°ν™”
541
- lastSupportSpawn = 0; // 슀폰 타이머 μ΄ˆκΈ°ν™”
542
- startCountdown();
543
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  function startBossStage() {
545
  isBossStage = true;
546
  enemies = [];
 
315
  this.hasPlayedSound = false;
316
  this.hasPlayedMGSound = false;
317
  this.isReturning = false;
318
+ this.circleAngle = 0; // μ›ν˜• 비행을 μœ„ν•œ 각도 μΆ”κ°€
319
  }
320
 
321
  selectTarget() {
 
361
  if (!this.isReturning) {
362
  this.isReturning = true;
363
  this.target = null;
 
364
  this.angle = Math.atan2(canvas.height/2 - this.y, canvas.width/2 - this.x);
365
  } else {
366
  this.angle = Math.PI;
 
380
  if (this.target) {
381
  this.angle = Math.atan2(this.target.y - this.y, this.target.x - this.x);
382
  }
383
+ } else {
384
+ // 적이 없을 λ•Œ μ›ν˜• λΉ„ν–‰
385
+ const centerX = canvas.width / 2;
386
+ const centerY = canvas.height / 2;
387
+ const radius = Math.min(canvas.width, canvas.height) / 4; // μ›μ˜ λ°˜μ§€λ¦„
388
+
389
+ this.circleAngle += 0.02; // μ›μš΄λ™ 속도
390
+ const targetX = centerX + Math.cos(this.circleAngle) * radius;
391
+ const targetY = centerY + Math.sin(this.circleAngle) * radius;
392
+
393
+ this.angle = Math.atan2(targetY - this.y, targetX - this.x);
394
  }
395
  }
396
 
 
540
  lastJU87Spawn = Date.now(); // ꡬ맀 μ¦‰μ‹œ 슀폰 타이머 μ΄ˆκΈ°ν™”
541
  }
542
  }
543
+ function initRound() {
544
+ enemies = [];
545
+ for(let i = 0; i < 1 * currentRound; i++) {
546
+ enemies.push(new Enemy());
 
 
 
 
 
 
 
547
  }
548
+ player.health = player.maxHealth;
549
+ bullets = [];
550
+ items = [];
551
+ supportUnits = []; // 지원 μœ λ‹› μ΄ˆκΈ°ν™”
552
+ lastSupportSpawn = 0; // 슀폰 타이머 μ΄ˆκΈ°ν™”
553
+
554
+ // JU87 초기 슀폰 μΆ”κ°€
555
+ if (hasJU87) {
556
+ supportUnits.push(new JU87());
557
+ lastJU87Spawn = Date.now();
558
+ }
559
+
560
+ startCountdown();
561
+ }
562
  function startBossStage() {
563
  isBossStage = true;
564
  enemies = [];