I'm working on this small animation library. It adds a straightforward way to animate an object's state.
Let's say there's a game object called "progress", representing a progress bar we want to animate:
we could animate the value rising from 0 to 100 by adding this to something that triggers the progress to start:
and in _update() we want to call the animate() function to keep updating the value, until it's duration has elapsed:
There are some global variables you can override:
You can also add your own easing functions:
Tweens are removed automatically once the animation completes. Starting a new animation for a key with an active animation will overwrite the previous one, continuing animating from it's current value.
The most recent version is available at https://github.com/thykka/pico-8-libs/blob/main/animate.lua