Components - acrimi/Raven GitHub Wiki

Summary of components object

Configuration

Components can be configured with entries into the components object, where the key is the name of the component to add to this entity and the value is an object holding the initialization parameters for that component. For example, to define a SpatialComponent on an entity, you could add:

"SpatialComponent": {
  "width": 16,
  "height": 16,
  "orientation": "left"
}

Full documentation of supported initialization parameters can be found on each component's reference page.

In addition to component-specific parameters, the special "attached" parameter can be defined on any component to define its initial attachment state to the entity. By default, all components are initially attached, but you can initialize a component in a detached state by passing false for the "attached" parameter:

"SelfDestructComponent": {
  "attached": false,
  "duration": 1000
}

This allows you to pre-define all behaviors and properties for an entity even if some behaviors or properties should not be immediately active after spawning.