AlysiumX Posted July 16, 2015 Share Posted July 16, 2015 So I am having issue getting my animation frame to reset to standing. I traced the logic and it is actually hitting play on the stand animation, but its not setting it. Here is my code: Setupthis.sprite.animations.add('StandBackward', 'stand_up.png');Animation Logicif(this.direction == GameTypes.Direction.Up){ if(this.attacking){ this.sprite.animations.play('AttackUp'); if(this.sprite.animations.currentFrame.name == "attack_up_2.png" && !this.justAttacked){ this.justAttacked = true; this.attackHitBox.x = this.sprite.x - 25; this.attackHitBox.y = this.sprite.y - 60; } } else if(this.blocking){ this.sprite.animations.play('BlockUp'); } else if(this.moving){ this.sprite.animations.play('WalkBackward'); } if(!this.attacking && !this.blocking && !this.moving){ this.sprite.animations.play('StandBackward'); }}Thanks Edit : I figured it out apparently animations do not reset after you play them, so I had to manually reset it to first frame on the complete animation event handler using this.sprite.animations.stop(null, true); Link to comment Share on other sites More sharing options...
Recommended Posts