In Concord you start with an empty World.
local world = Concord.World()
In Concord you start with an empty World.
local world = Concord.World()You first define the shapes of the characteristics that exist in the World by defining Components.
Concord.Component("position", function (component, x, y) component.x = x component.y = yend)Your World can have any number of Entities.
local Cat = world:newEntity()local Rock = world:newEntity()The characteristics that we previously defined can be given to Entities.
Cat:give("position", 50, 50)Finally there are Systems. These define filters that allow them to have a subset of all Entities.
local Movement = Concord.System("Movement", {movers = { "position" }})
world:addSystem(Movement)Systems can also listen to events and iterate over those filtered lists.
function Movement:move () for i, entity in ipairs(self.movers) do entity.position.x = entity.position.x + 5 endendYou fire those events from the World using emit.
world:emit("move")