open-index/open-npm huggingface dataset:
npm package: @rutan/frame-tween
Description: A simple tween animation for fixed frame rate games
Author: rutan
Latest version: 0.7.0

# frame-tween

## install

```
npm install @rutan/frame-tween
```

## Usage

```typescript
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();
```