> 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/components/component/physic.md).

# Physic

you only need to set "status:true". other parts are for editing physics

{% code overflow="wrap" fullWidth="false" %}

```javascript
physic: {
    status: true,//set the physic state
    x:5,//You enter how far it should travel at position x
    y:22,//You enter how far it should travel at position y
    gravity:213,//by default gravity is set to 0.3
    xfriction:,//friction at x
    yfriction:,//friction at y
 }
```

{% endcode %}

## Function

{% code overflow="wrap" %}

```javascript
physicout = function(obj,data){
console.log(obj)//the name of the object
if(data.flying) console.log("you are flying")
if(data.top) console.log("now from the top")
if(data.right) console.log("now from the right")
if(data.left) console.log("now from the left")
if(data.bottom) console.log("now from the bottom")
if(data.friction) console.log("now from the friction")
}
```

{% endcode %}
