Advertisement
Guest User

Untitled

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