Jump to content

Animation reverse [Solved]


samriggs
 Share

Recommended Posts

Hello all

I been trying trying to get a sprite sheet to play forward (no problem to do that one) but then play it in reverse also for a game that needs it to go forward backward and pause/stop animated sprite sheet.

I seen there is a reverse and isReversed for animation but for the life of me I can't get it working.

I take it it has been added to the framework anyone know how to implement it?

Any help would be greatly appreciated and thanks in advance.

Sam

Ps: just in case anyone offers a fix to work off of two sprite sheets, I am trying to avoid this, and to have it move forward/backward/pause from one sprite sheet.

the forward and pause is no problem just the reverse part. Thanks again in advance.

 

EDIT: lol a few moments more playing round with it and I figured it out, sorry about that.

I'll put it here in case anyone else has this issue.

var purball;
var puranim;
purball = this.game.add.sprite(133, 360,"purpleball");
puranim = purball.animations.add('walk');
puranim.play(10, true);
puranim.reverse();

I'm sure there is more that can be done to this but I was just glad to see it working. Pretty simple and sweet

 

Edited by samriggs
found the fix
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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