CODE
API
COPY/PASTE SOURCE
What is this?
tiny-ecs is a Lua module for implementing entity component systems (ECS) in a fast and flexible way. For those unfamiliar with ECS, I recommend reading the wikipedia page on it. It's the hip, cool, and not-so-new trend in how to structure a game. This should make your games easier to extend, reason about, and scale.
Why?
One of LOVE's greatest strengths and also greatest weaknesses is a lack of defined structure for games. You're just given library calls, a few callbacks to build off of, and told to get going. Without some structure, it's hard to make a medium sized game, let alone a large or marketable product. tiny-ecs is a framework / library that facilitates proven and intelligent ways to structure games.
How?
So I was making a game, and I did what probably every developer and hobbyist has done at some point, and I started making a library rather than a game.

Demos
I personally have used tiny-ecs in two Ludum Dares successfully. I evolved the syntax and capabilities of tiny-ecs as I realized how I liked to use it and I realized how other people used it. Keep in mind that the demo code is not always a pure example of entity component systems; they are practical examples that show ONE WAY how to use tiny-ecs to make a game. I am sure there is impractical code aplenty in the demos, but don't worry - tiny-ecs.lua itself has much cleaner code.
Also keep in mind that the demos may be using an older version of tiny-ecs that is slightly different than the current one. When there is a disagreement between the API and a demo, the API wins.
DEMO1 - COMMANDO KIBBLES
DEMO2 - WEREGOAT
Feedback is appreciated.
