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