les, lightweight entity system + snake example game

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
bdjnk
Citizen
Posts: 81
Joined: Wed Jul 03, 2013 11:44 pm

les, lightweight entity system + snake example game

Post 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 187 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests