Log In  


Cart #tomewafagi-1 | 2025-05-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

hey everyone, I was watching this video going over the basics of ECS, and I was inspired to try a lightweight pico-8 implementation of the concept. this is pretty rough and unoptimized, but I thought I'd post it here in case it's of use to anyone or happens to spark a conversation.

I implemented it slightly differently, with the "systems" and "relations" part bundled into one system I refer inside as "relations". essentially, you can easily specify pairs of entity types to call a function over. this is the part that isn't super optimized, since there's no caching going on. but the upside is the whole thing is only 242 tokens atm.

tab 0 is the boilerplate, tab 1 is an example of it in use.

personally, I feel it's a bit overkill (at least for how I use pico-8) but it was fun to write and if anyone happens to get use or inspiration out of it that's a great bonus!

edit: i updated it to add caching lists for the relations, as well as a dedicated draw function. now it is 412 tokens, but it should scale better for games that need it




[Please log in to post a comment]