Cambiar lógica de generación de enemigos
This commit is contained in:
parent
2756d1e54c
commit
24146623cd
1 changed files with 1 additions and 1 deletions
|
@ -221,7 +221,7 @@ export function update(juego: Juego<State>, dt: number) {
|
|||
}
|
||||
|
||||
while (juego.state.enemies.length < ENEMIES_NUM) {
|
||||
const x = Math.random() * MAP_SIZE + MAP_MIN;
|
||||
const x = Math.random() * 6000 + juego.state.pos.x;
|
||||
// Don't spawn enemies too close
|
||||
if (Math.abs(juego.state.pos.x - x) < 300) continue;
|
||||
juego.state.enemies.push({
|
||||
|
|
Loading…
Reference in a new issue