Jump to content

Does it make sense to destroy all sprites when switching states?


Puzz3l
 Share

Recommended Posts

Is it necessary to create a shutdown method like so to free up memory or is dealt with automatically?

shutdown: function() {  this.space.onDown.dispose();  this.arrow.destroy();  this.bombs.destroy();  this.blasts.destroy();  this.waves.destroy();  this.explosions();  this.enemies.destroy();  this.spawnAnim.destroy();  this.waveCharge.destroy();  this.label_score.destroy();  this.label_highscore.destroy();  this.game.time.events.remove(this.enemySpawnTimer);}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...