All right, so I finally fixed those darn vines animations. It was a silly issue with the length of the vine growth animation being longer than the length of the leaves growth animations. So I just lengthened the duration per frame for the leaves growth animations to match that of the vine growth animation, since they all had the same number of frames.
On a side note, I do want to say that I love the animation system I’ve made. It’s simple, but it’s exactly what I need. When I instantiate an animation, it fetches its properties from the AnimationProperties class, which has just three fields:
- frames: the number of frames
- durationPerFrame: how many milliseconds to spend on each frame
- type: the cool stuff!
So the type field can be either DISPOSE, KEEP, or LOOP, which define what happens when the last frame of the animation has spent its defined time on screen:
- DISPOSE: get rid of the animation. This is used for implosions, for example.
- KEEP: keep the animation on its last frame. This is used for player remains, such as ashes and sawed body parts, when they’re on the ground. The remains remain on screen to show the devastation of the battle!
- LOOP: repeat the animation. This is used for saws, as well as for player remains while they’re airborne.
This makes it very easy to set up new animations of different types. I think it also leads to less memory footprint for remains of the same type, since for their static properties, they just point to the same instance of AnimationProperties.
OK, side note over! In other news which impacts the development of THE MISSION, we are moving into a new home in a couple of weeks, so more time will be spent packing, and then unpacking, and so on. Also, my wonderful wife has started her Masters degree in Global Health!! This means I”ll be spending more time taking care of our household, so she can focus more on her studies. I’ll keep working on THE MISSION as much as I can, but it will likely be affected. I’ll have a better picture of the effect in a couple of weeks.
In the meantime, the next thing I have to do is to make some animations, for when players are captured by regrowing vines. For working on animations I need to set off blocks of several hours, so it isn’t something I can do during my commute to and from work (which is when I do most of the programming). I’ll figure it out though, so keep an eye out for WIP gifs!