Borrar semillas automáticamente

This commit is contained in:
Nulo 2021-06-28 19:20:54 +00:00
parent 876bb8a9e5
commit fe0acd5bc0
1 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,8 @@ export function update(juego: Juego<State>, dt: number) {
juego.state.enemies = juego.state.enemies.filter(e => e.x !== enemy.x) juego.state.enemies = juego.state.enemies.filter(e => e.x !== enemy.x)
} }
} }
if (Math.abs(seed.velocity.x) < 100)
juego.state.seeds = juego.state.seeds.filter(s => s.velocity.x !== seed.velocity.x)
} }
while (juego.state.enemies.length < ENEMIES_NUM) { while (juego.state.enemies.length < ENEMIES_NUM) {