summaryrefslogtreecommitdiff
path: root/honey/ecs.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-05-07 21:16:13 -0500
committersanine <sanine.not@pm.me>2023-05-07 21:16:13 -0500
commit61f8813b0beb6228f99cf0ea80acee5f4cab063f (patch)
treec4eca7d64a045b70f0eca34d02162235c1a6acdd /honey/ecs.lua
parent445fc5217859a799e3a977c9763141d9a5f6cbb5 (diff)
correctly implement capsule collisions and camera view matrix
Diffstat (limited to 'honey/ecs.lua')
-rw-r--r--honey/ecs.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/honey/ecs.lua b/honey/ecs.lua
index 260c389..b0409e4 100644
--- a/honey/ecs.lua
+++ b/honey/ecs.lua
@@ -146,6 +146,14 @@ function EntityDb.addComponents(self, id, components)
end
+-- create an entity with components
+function EntityDb.createEntityWithComponents(self, components)
+ local id = self:createEntity()
+ self:addComponents(id, components)
+ return id
+end
+
+
-- get all entities with a given component
function EntityDb.queryComponent(self, name)
local component = self.components[name]