A downloadable tool

Download NowName your own price

Tween

... is small library to create simple as possible tweens in PICO-8 for your next game or tool.



In 2023 I decided to implement a tween library for the PICO-8 1k-Jam. Therefore the library had to fit into 1024 compressed bytes. In the end it needed only 837 compressed bytes with readable code and comments.

PICO-8 is great, but I miss the collision and tween functionalities the most. The last one is not a problem anymore 😊.

So remember, this library is a gift for all beginners in PICO-8 to make animations and create excellent games from scratch.

Simple example

Copy the complete source code of tween into PICO-8 (maybe as new tab). After that you can use the functions of tween as following:

-- some object
t={x=1, y=2}
function _init()
 -- create a new tween
 tweens.create()
 -- add a motion for t[x] and move it to x=10 in 3s (linear)
 .add(t, "x", 10, 3)
 -- stay for 1s
 .delay(1)
 .start()
end
 
function _update60()
 -- update all tweens in each frame
 tweens.update()
end

API

tweens.create()
 -- all motions will played in parallel
 .parallel()
 -- adds a new motion for obj[key] to bring it to target in duration in seconds
 .add(obj, key, target, duration, easing)
 -- stay for a duration in seconds
 .delay()
 -- set a listener for finished tweens. It will call listener(tween)
 .on_finish(some_function)
 -- starts the tween
 .start()
 -- stops the tween
 .stop()
 
-- easings
tweens.linear
tweens.ease_in_quad
tweens.ease_out_quad
tweens.ease_in_sin
tweens.ease_out_sin

Download

Download NowName your own price

Click download now to get access to the following files:

Tween libary
External

Leave a comment

Log in with itch.io to leave a comment.