Page 1 of 1

les, lightweight entity system + snake example game

Posted: Wed Oct 15, 2014 12:13 am
by bdjnk
les is a love / lua / lightweight entity system said thusly in my head.

Why, you ask? Because hey, you can never have too many. Actually, it was because I couldn't really wrap my mind around practical usage. I figured if I made my own I might truly grok it.

The code is short and readable (imho). Usage can be gleaned from the code. These are the available functions:

Code: Select all

les.s.set(of, sort, f(e) reqs, f(e, ...) code) -- creates a system
les.e.set({}) -- creates an entity, returns an eid
les.e.get(eid) -- gets an entity by eid
les.e.all(uid, reqs) -- returns a set of entities
les.e.del(eid) -- deletes an entity
It's incomplete in that I haven't tested it extensively. Anyway, here it is for your tinkering pleasure.
les.love
(2.53 KiB) Downloaded 189 times