@rutan/frame-tween
v0.6.1
Published
A simple tween animation for fixed frame rate games
Downloads
11
Readme
frame-tween
install
npm install @rutan/frame-tween
Usage
import { createTween, Group, easeInOutSine } from '@rutan/frame-tween';
const tweenGroup = new Group();
const tween = createTween(sprite, tweenGroup, {
x: 0,
})
.to(
{
x: 100,
},
30,
easeInOutSine,
)
.call(() => {
console.log('finished!');
})
.start();
function mainLoop() {
requestAnimationFrame(mainLoop);
tweenGroup.update();
}
mainLoop();