> 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.md).

# Component

Let's just define an example

{% hint style="warning" %}
"\*" at the beginning indicates that it must be entered
{% endhint %}

```javascript
const player1 = new Component({
  name: "player1",//*Component name
  inscreen: true,//prevents exiting the screen
  physic: {
    status: true//Adds physics
  },
  position: {//*starting position
    x: 0,
    y: 0,
  },
  scale: {//*how big will it be
    x: 100,
    y: 180,
  },
  color:"red",//optional color
  notick:false//Turns off physics and collision rendering optimization
});
```

![](/files/Nn5kfEQPqo4W5XPKm9ff) :tada::tada::tada: **Yes we created a new object**

## Update&#x20;

<pre class="language-javascript"><code class="lang-javascript"><strong>player1.update({
</strong>    physic:{
        x:5,
        y:20
    }
<strong>})
</strong><strong>//or 
</strong>updateData({
    name:"player1",
    physic:{
        x:5,
        y:20
    }
})
</code></pre>

## Get

```javascript
console.log(player1.get())
console.log(getData("player1"))
//Example
console.log(
player1.get().physic.x
)
```

## Remove

```javascript
player1.remove()
removeData("player1")
```
