Advertisement
Guest User

Untitled

a guest
Aug 13th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class DestroyTest {
  2.     public sprite:Phaser.Sprite;
  3.  
  4.     public test():void {
  5.         if(this.sprite != undefined){
  6.             this.sprite.destroy();
  7.         }
  8.  
  9.         var bitmapData: Phaser.BitmapData = game.make.bitmapData(50, 50);
  10.         this.sprite = new Phaser.Sprite(game, 0,0, bitmapData);
  11.     }              
  12. }
  13. // This block is what causes this.sprite.destroy(); to be removed from the top class
  14. class OtherClass {
  15.     public destroy():void {}
  16. }
  17. // =======================
  18. var game = new Phaser.Game(    
  19.     50,
  20.     50,
  21.     Phaser.AUTO,
  22.     'phaser-game',
  23.     {
  24.         create: function(){
  25.             var destroyTest:DestroyTest = new DestroyTest();
  26.             destroyTest.test();
  27.         }
  28.     }
  29. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement