1 decade ago by niroop
when a animation is running, is it possble at any frame to reverse the animation frame flow (not flipping) ? I used rewind(), it only gets back to the first frame, is there any reverse()?
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
this.addAnim( 'whateveranimation', 0.1, [0,1,2,3] );
this.addAnim( 'whateveranimation', 0.1, [0,1,2,3,2,1,0] );
this.addAnim( 'whateveranimation2', 0.1, [3,2,1,0] );
039;s own <2> to reverse the #sequence
array of the Animation. Untested:anim.sequence.reverse(); anim.gotoFrame( anim.sequence.length - anim.frame - 1);
gotoFrame()
call is necessary to jump to the current frame again - e.g. when an Animation with 8 frames is at frame 2, after reversing the sequence this frame number 2 becomes 8 - 2 - 1 = 5. The '-1' is because frame numbering starts at 0, so the 8th frame is frame number 7. I hope that makes sense... function GetMeMySpeed(player){ var speedometerarray = new Array; for (var i = player.speed , i >=0, i--){ speedometerarray.push(i); } return speedometerarray; }
if (player.buttonrealeased == 1){ var whateverarray = GetMeMySpeed(this); this.addAnim( 'whateveranimation', 0.1, whateverarray ); }