I ask this because i think getType function adding same Entities multiple times into the vector in override update function. Or somebody tell me please why my game getting slower and slower in a few seconds . . . :/?
world.getType("enemy", elist);
world.getType("pbullet", pblist);
for each (var e:Enemy in elist)
{
for each (var pb:Bullet in pblist)
{
if (pb.collideWith(e,pb.x,pb.y) && !pb.removed())
{
pb.hit.play();
var hitanim:Entity = world.add(new HitAnim());
hitanim.x = pb.x;
hitanim.y = pb.y;
world.remove(pb);
}
}
}