Jump to content

if(false) = true WTF o_O


titmael
 Share

Recommended Posts

Hi,

 

I've got a strange problem, the code goes through the if but the condition is false, I'm using Phaser 2.0.5 :

 

2014-06-16_15h28_10.png

 

It happens when I try to destroy a sprite after an animation is complete, here is the code :

function Explosion(game, x, y){    this.game = game;    Phaser.Sprite.call(this, this.game, x, y, 'explode');    this.anchor.setTo(.5, 1);    this.explosionAnim = this.animations.add('boum', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10, false);    this.explosionAnim.onComplete.add(this.destroyExplosion, this);    this.explosionAnim.play();}Explosion.prototype = Object.create(Phaser.Sprite.prototype);Explosion.prototype.constructor = Explosion;Explosion.prototype.destroyExplosion = function(){    this.destroy();}

I really don't get why I have this behavior ... any help would be nice, I can't live with this  :wacko:

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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