collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
895 stars 101 forks source link

Improve support for reversed animations #81

Open collinsmith opened 4 years ago

collinsmith commented 4 years ago

3906fbdf4cb0f368bf7cdaa75b2b46088792643a added support for playing animations in reverse for data\global\ui\CURSOR\pentspin.DC6 on the escape menu, but an animation acting in reverse will still report as if everything is normal, e.g., first frame will call notifyAnimationFinished. Should this be the expected behavior?

I considered creating a reverse() function which generates a duplicate Animation with the array data reversed as an easy solution. Could also add additional modes for the reversed versions ONCE_REVERSED, LOOP_REVERSED, CLAMP_REVERSED which seems better. Could even subclass Animation with like ReversedAnimation and override where necessary -- but I'm not as happy about this one.

I'm creating this issue so that if it ever comes up when an animation somewhere else needs support for reversing and runs into problems.