Tweens
The tween module takes care of the process of interpolating a value from one state to another over a certain duration.
For example, moving a sprite from x = 0 to x = 100 over 1 second.
The tween module handles this automatically with smooth motion, easing, and callbacks.
Using the tween module for value interpolating allows for smoother or fancier results than linear calculations.
This is the list of Easing functions you can choose from:
- quadIn
- quadOut
- cubeIn
- cubeOut
- cubeInOut
- quartIn
- quartOut
- quartInOut
- quintIn
- quintOut
- quintInOut
- sineIn
- sineOut
- sineInOut
- bounceIn
- bounceOut
- bounceInOut
- circIn
- circOut
- circInOut
- expoIn
- expoOut
- expoInOut
- backIn
- backOut
- backInOut
- elasticIn
- elasticOut
- elasticInOut
The best way to understand this is to check the Tweens example.