cutechicken
commited on
Update index.html
Browse files- index.html +45 -50
index.html
CHANGED
@@ -256,58 +256,53 @@
|
|
256 |
}
|
257 |
}
|
258 |
class SupportUnit {
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
}
|
272 |
-
|
273 |
-
update() {
|
274 |
-
// ์ด๋
|
275 |
-
this.x += this.speed;
|
276 |
-
// ๋ฐ์ฌ (1์ด์ 5๋ฐ)
|
277 |
-
const now = Date.now();
|
278 |
-
if (now - this.lastShot > 200) {
|
279 |
-
this.shoot();
|
280 |
-
this.lastShot = now;
|
281 |
-
}
|
282 |
-
return this.x < canvas.width;
|
283 |
-
}
|
284 |
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
300 |
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
|
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
class JU87 {
|
313 |
constructor() {
|
|
|
256 |
}
|
257 |
}
|
258 |
class SupportUnit {
|
259 |
+
constructor(yPosition) {
|
260 |
+
this.x = 0;
|
261 |
+
this.y = yPosition;
|
262 |
+
this.speed = 5;
|
263 |
+
this.lastShot = 0;
|
264 |
+
this.width = 100;
|
265 |
+
this.height = 100;
|
266 |
+
this.angle = 0;
|
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 |
+
}
|
281 |
+
return this.x < canvas.width;
|
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({
|
297 |
+
x: this.x + Math.cos(this.angle) * 30,
|
298 |
+
y: this.y + Math.sin(this.angle) * 30,
|
299 |
+
angle: this.angle,
|
300 |
+
speed: 10,
|
301 |
+
isEnemy: false,
|
302 |
+
damage: weapons.machinegun.damage,
|
303 |
+
size: weapons.machinegun.bulletSize
|
304 |
+
});
|
305 |
+
}
|
306 |
}
|
307 |
class JU87 {
|
308 |
constructor() {
|