HOW TO:
Press Z to make spaceship move to another position
Cart uses ease_in_out_cubic (but feel free to edit and change to another included easing function).
Animation is locked at 0.5 seconds per move (feel free to edit this, too)
ABOUT:
Here is my attempt at providing tweening/easing functions in PICO-8.
They are based on existing work done by many other people.
These functions help you animate sprites smoothly from one position to another, with different types of acceleration and/or deceleration.
I am using them to animate cards around the screen in my Hanafuda Koi-Koi game.
To read more about Easings, go here: http://easings.net
Working:
Linear
Quadratic
Cubic
Quartic
Quintic
Sinusoidal
Exponential
Circular *
- partially working
Maybe these are broken because I'm not familiar enough with how PICO-8 maths functions work?
Any help appreciated getting those last few working is appreciated!
Thanks,
matt
The sin and cos functions work from 0 to 1 instead of 0 to 2pi. That might be the issue there. It's worth looking up all the math fcns in the pico8.txt reference file, because there's some weirdness there. =)
still broken:
ease_in_sine
ease_in_expo
ease_in_circ
not enough precision for:
ease_out_expo
ease_in_out_expo
ease_out_circ
ease_in_out_circ
I tested the cart in picolove, which has no math limitations, and this showed me that the calculations work. So they are too much for standard pico8 maths. Any way around this?
Could this have to do with the fixed point 16.16 numbers in PICO-8? If the precision is off, try using the full 32 bits for calculation (shl() and shr() will help here).
Most likely it does.
I'll have to look into shl() and shr() it's been a long time since I've used those
[Please log in to post a comment]