Jump to content

Got exception on destroying sprites


hvj
 Share

Recommended Posts

I'm getting exception when I destroy a sprite on a collide.

I'm detroying that sprite onEndContact of collision.

 

Exception is:

"this.sprite is null" on first line of "postUpdate" file.

 

/**

* Internal method. This is called directly before the sprites are sent to the renderer and after the update function has finished.
*
* @method Phaser.Physics.P2.Body#postUpdate
* @protected
*/
postUpdate: function () {
 
this.sprite.x = this.world.mpxi(this.data.position[0]);
this.sprite.y = this.world.mpxi(this.data.position[1]);
 
if (!this.fixedRotation)
{
this.sprite.rotation = this.data.angle;
}
 
},
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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