Spaces:
Running
Running
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 = {
|
|
@@ -2003,7 +2003,7 @@ class Game {
|
|
| 2003 |
|
| 2004 |
spawnEnemies() {
|
| 2005 |
const spawnEnemy = () => {
|
| 2006 |
-
if (this.enemies.length <
|
| 2007 |
const position = this.getValidEnemySpawnPosition();
|
| 2008 |
if (position) {
|
| 2009 |
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 = 5;
|
| 14 |
const PARTICLE_COUNT = 15;
|
| 15 |
const BUILDING_COUNT = 50;
|
| 16 |
const ENEMY_CONFIG = {
|
|
|
|
| 2003 |
|
| 2004 |
spawnEnemies() {
|
| 2005 |
const spawnEnemy = () => {
|
| 2006 |
+
if (this.enemies.length < 5 && !this.isGameOver) { // μ΅λ 5λλ‘ μ ν
|
| 2007 |
const position = this.getValidEnemySpawnPosition();
|
| 2008 |
if (position) {
|
| 2009 |
const type = Math.random() < 0.7 ? 'tank' : 'heavy';
|