在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):nidorx/ecs-lua开源软件地址(OpenSource Url):https://github.com/nidorx/ecs-lua开源编程语言(OpenSource Language):Lua 100.0%开源软件介绍(OpenSource Introduction):What is it?ECS Lua is a fast and easy to use ECS (Entity Component System) engine for game development. The basic idea of this pattern is to stop defining entities using a hierarchy of classes and start doing use of composition in a Data Oriented Programming paradigm. (More information on Wikipedia). Programming with an ECS can result in code that is more efficient and easier to extend over time. How does it work?Talk is cheap. Show me the code!local World, System, Query, Component = ECS.World, ECS.System, ECS.Query, ECS.Component
local Health = Component(100)
local Position = Component({ x = 0, y = 0})
local isInAcid = Query.Filter(function()
return true -- it's wet season
end)
local InAcidSystem = System("process", Query.All( Health, Position, isInAcid() ))
function InAcidSystem:Update()
for i, entity in self:Result():Iterator() do
local health = entity[Health]
health.value = health.value - 0.01
end
end
local world = World({ InAcidSystem })
world:Entity(Position({ x = 5.0 }), Health()) FeaturesECS Lua has no external dependencies and is compatible and tested with Lua 5.1, Lua 5.2, Lua 5.3, Lua 5.4, LuaJit and Roblox Luau
GoalTo be a lightweight, simple, ergonomic and high-performance ECS library that can be easily extended. The ECS Lua does not strictly follow "pure ECS design". UsageRead our Full Documentation to learn how to use ECS Lua. Get involvedAll kinds of contributions are welcome! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论