easier way to understand tweens

Hey everyone, I have attempted to learn how to understand tweens. However I don’t really understand it. Any of it. I was trying to understand how to create them. (Thinking that is the hardest step to learn.) But all the things I’ve researched didn’t make any scenes. Anyway, I was wondering if there was a video tutorial or something on tweening.
Thanks.

Have you tried this yet by @Ignatz.

https://coolcodea.wordpress.com/2014/01/24/146-playing-with-tween-functions/

@Progrmr235 - essentially, tweens are simply “for” loops that interpolate numbers from one value to another. Some of them have fancy effects that speed up or slow down, or even repeat or reverse the interpolation, but that’s all they do - interpolate numbers, so you can make objects move nicely on the screen.

@Progrmr235 Just in case you need an example, here’s one that keeps moving a sprite from one side of the screen to the other.


displayMode(FULLSCREEN)

function setup()
    sp={x=0,y=HEIGHT/2}
    tween(5,sp,{x=WIDTH,y=HEIGHT/2},
        {easing=tween.easing.linear,loop=tween.loop.pingpong})
end

function draw()
    background(40, 40, 50)
    sprite("Planet Cute:Character Boy",sp.x,sp.y)
end