survivors: fixing drops being duplicated (sometimes)

adding item container system to not edit the list while iterating over
This commit is contained in:
Sheldan
2025-08-30 20:24:35 +02:00
parent e44355bf21
commit b591fc2dee
3 changed files with 65 additions and 33 deletions

View File

@@ -7,6 +7,7 @@ import {Vector} from "./base.ts";
import {BasicEnemy, ContainerEnemy, Enemy, HealthEnemy, ShootingEnemy} from "./Enemies.ts";
import {HUD} from "./ui.ts";
import {HomingPistol, Pistol} from "./weapons.ts";
import {MoneyDrop} from "./drop.ts";
let hud: HUD;
@@ -107,7 +108,6 @@ docReady(function () {
world = new World(player, ctx, new Vector(window.innerWidth, window.innerHeight));
state = new WorldState();
ShootingEnemy.spawnShootingEnemy(world, new Vector(350, 350))
setInterval(() => {
BasicEnemy.spawnBasicEnemy(world)
ShootingEnemy.spawnShootingEnemy(world)