0

I am using sprites for my game in Canvas-Engine and is there possible way to play animation backwards. If I put frames from 10 to 0 it does not work.

animations:{ frames: [10, 0] }

Or is there way to mirror the image at each loop? But in some sprites its not a option. Thanks.

Jānis Veiss
  • 147
  • 1
  • 1
  • 9

1 Answers1

0

I've no idea what you want (you have to be much more specific in your question!)

But I did this:
http://jsfiddle.net/neuroflux/qs37w/2/

It basically, animates from frame 0 to frame 10 then runs a switch to reverse it.

This runs as fast as the requestAnimFrame runs.

Barrie Reader
  • 10,647
  • 11
  • 71
  • 139
  • Nice, but I need it in this engine http://canvasengine.net/ To run from last to first frame. There are extension Animation, witch allows you to run sprite sheets and the frames variable contains array where `array[0] = FirstFrame` and `array[1] = LastFrame` I need to get `array[0] = LastFrame` and `array[1] = FirstFrame` Engien does not allow this kind of array. – Jānis Veiss Aug 24 '15 at 09:53