Entity: The entity is a general-purpose object. It only consists of a unique ID. They "tag every coarse game object as a separate item". Example:
Entity.create id world
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Start point for spawning Entity
Entity.create id world
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Set component to spawn with a new entity
Entity.create ( id, world )
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Way to create Entity destruction functions, should pipe in all possible component specs.
It also can be used to just disable (remove) some components from an entity.
remove =
Entity.remove positionSpec
>> Entity.remove velocitySpec
newWorld =
remove ( id, world )