Closed 0xnicholasc closed 4 years ago
I'm not sure what a valid use case for this is. Can you give an example, please?
I'm not sure what a valid use case for this is. Can you give an example, please?
It is useful when you have an animation that is a mirror image of itself on the center frame. Consider this simple 3-frame walking animation.
Ping-pong mode allows me to avoid defining it as a 4 frame animation. In situations with larger number of frames it saves even more work.
[Edit]If you think of an oscillating action like the swing of a pendulum, it applies there as well. You only need frames for the swing in one direction. Once it reaches the apex on one side, the animation will reverse until it reaches the other side's apex, and reverse again.
It's a pretty common feature in different animation software and game engines. I actually added it because I needed it for my use-case.
Sorry it's taken me a while to get back to you on this.
With the release of PGE2, I plan to do an extensive rewrite of this PGEX to add support for some of the features that PGE2 offers.
As part of that, I will likely add in the ping-pong feature, so for now I'm going to close this PR.
Added the concept of PLAY_MODE. FORWARD is the default/original behavior. PING_PONG plays the frames forwards, then backwards, then forward again, etc...
I also moved the member variable declarations above the prototypes so that function prototypes can use the enums