> For the complete documentation index, see [llms.txt](https://electoriaengine.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://electoriaengine.gitbook.io/api/eap/anime-and-hammer.md).

# Anime and Hammer

## Anime

change position smoothly

{% code overflow="wrap" %}

```javascript
anim({
 name:"player1",//obj name
 position:{//write down the destination
     x:5,y:5
 },
 time:1000,//automatically set to 1000(ms) if you do not enter time
 type:"linear"//automatically set to "linear" if you do not enter time
})
```

{% endcode %}

{% embed url="<https://1070416189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAoN3PvLitJVdWdsmwATH%2Fuploads%2F92NcvfhiZZxfgTijVmTL%2Fanime.mp4?alt=media&token=c7d87a58-c528-43f7-b5e3-914e7e2ca5d8>" %}

{% hint style="info" %}
To view more types: <https://codepen.io/kcjpop/pen/GvdQdX>
{% endhint %}

{% hint style="warning" %}
anime.js must be installed
{% endhint %}

### Install anime.js

```javascript
require("https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js")
```

***

## Hammer

records your swiping movements

{% code fullWidth="true" %}

```javascript
starthammercanvas()
hammercanvas = function(location,time){
    console.log(
    location,//is the direction in which it drags possible outputs: RIGHT,LEFT,UP,DOWN
    time//the time it is held down
    )
}
```

{% endcode %}

{% embed url="<https://1070416189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAoN3PvLitJVdWdsmwATH%2Fuploads%2Fe6eV79RO4v1sN8nSS0no%2Fhammer.mp4?alt=media&token=28c91a09-2581-49c0-a8ea-e92b0c9c0b8c>" %}

{% hint style="warning" %}
hammer.js must be installed
{% endhint %}

### Install hammer.js

```javascript
require("https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js")
```
