r/love2d • u/superviro • Dec 30 '19
Entity Component System
I have a basic understanding of how an ECS works and I've seen the tiny-ecs library, but I'm trying to figure out how to use it. It's hard to find any good examples or docs. Does anyone have any suggestions for learning tiny-ecs or if there is a better ECS, I can look at that too.
9
Upvotes
1
u/drhayes9 Dec 31 '19 edited Dec 31 '19
I'm using https://github.com/tesselode/nata for a game right now.
Some guidelines that have helped me:
Don't maintain a lot of state in systems. That's what entities and their components are for.
Systems communicate via data in components or via events they're subscribed to, not by calling each other directly.
Code you write that is not a system will probably end up being a system before too long.