Spaces:
Running
Running
cutechicken
commited on
Update index.html
Browse files- 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 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
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 = [];
|