Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

AnimSprite is remain after stop and delete

$
0
0
// 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


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>