// Bullet
if(this.CurrentAnim.name == "bullet_dead")
this.CurrentAnim.Animsprite.onComplete = () => {
this.IsDead = true;
};
// Animation (animation class have member pixijs.animsprite)
this.update = function() // update is game loop
{
if(!this.loop)
{
this.Animsprite.onComplete = () => {
this.stopAnim(); // stop anim
delete this; // delete animation obj
};
}
}
// GameScene
if(this.arrGameObj[i][j].IsDead) // every loop check dead obj and remove it
{
delete this.arrGameObj[i][j]; // to null, release in memory
this.arrGameObj[i].splice(j); // pop in arrgameobj
continue;
}
// Here's recorded video that help you understand my problem clearly
2022-12-12 16-07-27.mkv