Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DestroyTest {
- public sprite:Phaser.Sprite;
- public test():void {
- if(this.sprite != undefined){
- this.sprite.destroy();
- }
- var bitmapData: Phaser.BitmapData = game.make.bitmapData(50, 50);
- this.sprite = new Phaser.Sprite(game, 0,0, bitmapData);
- }
- }
- // This block is what causes this.sprite.destroy(); to be removed from the top class
- class OtherClass {
- public destroy():void {}
- }
- // =======================
- var game = new Phaser.Game(
- 50,
- 50,
- Phaser.AUTO,
- 'phaser-game',
- {
- create: function(){
- var destroyTest:DestroyTest = new DestroyTest();
- destroyTest.test();
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement