Spaces:
Running
Running
cutechicken
commited on
Commit
β’
7d05cf8
1
Parent(s):
27e962a
Update game.js
Browse files
game.js
CHANGED
@@ -10,7 +10,7 @@ const ENEMY_GROUND_HEIGHT = 0;
|
|
10 |
const ENEMY_SCALE = 1;
|
11 |
const MAX_HEALTH = 1000;
|
12 |
const ENEMY_MOVE_SPEED = 0.1;
|
13 |
-
const ENEMY_COUNT_MAX =
|
14 |
const PARTICLE_COUNT = 15;
|
15 |
const BUILDING_COUNT = 50;
|
16 |
const ENEMY_CONFIG = {
|
@@ -1386,12 +1386,6 @@ class Game {
|
|
1386 |
|
1387 |
async initialize() {
|
1388 |
try {
|
1389 |
-
// λ‘λ© μμ
|
1390 |
-
this.isLoading = true;
|
1391 |
-
document.getElementById('loading').style.display = 'block';
|
1392 |
-
document.getElementById('startButton').disabled = true;
|
1393 |
-
document.getElementById('startButton').textContent = 'Loading...';
|
1394 |
-
|
1395 |
// BGMμ΄ μμ§ μ¬μλμ§ μμ κ²½μ°μλ§ μ¬μ
|
1396 |
if (!this.bgmPlaying && !this.bgm) {
|
1397 |
this.bgm = new Audio('sounds/BGM.ogg');
|
@@ -2009,7 +2003,7 @@ class Game {
|
|
2009 |
|
2010 |
spawnEnemies() {
|
2011 |
const spawnEnemy = () => {
|
2012 |
-
if (this.enemies.length <
|
2013 |
const position = this.getValidEnemySpawnPosition();
|
2014 |
if (position) {
|
2015 |
const type = Math.random() < 0.7 ? 'tank' : 'heavy';
|
|
|
10 |
const ENEMY_SCALE = 1;
|
11 |
const MAX_HEALTH = 1000;
|
12 |
const ENEMY_MOVE_SPEED = 0.1;
|
13 |
+
const ENEMY_COUNT_MAX = 3;
|
14 |
const PARTICLE_COUNT = 15;
|
15 |
const BUILDING_COUNT = 50;
|
16 |
const ENEMY_CONFIG = {
|
|
|
1386 |
|
1387 |
async initialize() {
|
1388 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
1389 |
// BGMμ΄ μμ§ μ¬μλμ§ μμ κ²½μ°μλ§ μ¬μ
|
1390 |
if (!this.bgmPlaying && !this.bgm) {
|
1391 |
this.bgm = new Audio('sounds/BGM.ogg');
|
|
|
2003 |
|
2004 |
spawnEnemies() {
|
2005 |
const spawnEnemy = () => {
|
2006 |
+
if (this.enemies.length < 3 && !this.isGameOver) { // μ΅λ 3λλ‘ μ ν
|
2007 |
const position = this.getValidEnemySpawnPosition();
|
2008 |
if (position) {
|
2009 |
const type = Math.random() < 0.7 ? 'tank' : 'heavy';
|