> For the complete documentation index, see [llms.txt](https://vypxl.gitbook.io/scar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vypxl.gitbook.io/scar/application-structure/components.md).

# Components

Components contain data for entities or act as tags. You have to create you own components by inheriting from the abstract `Scar::Component` or use the builtin ones.

There are numerous builtin components such as [sprite](/scar/builtin-components/sprite.md). You can find them in the 'Builtin Components' chapter of this book.

```ruby
class PlayerComponent < Scar::Component
    property :health, :attack
    def initialize(@health: Int32, @attack: Int32)
    end
end
...
# e. g. in app#init 
player = Entity.new("player",
    PlayerComponent.new(1337, 42),
    position: Vec.new(128, 128)
)

scene["level"] << player
```
