I was interested in how these system work. I needed a simple library that isn't too big and doesn't have unnecessary features nobody really needs.
There are alot of articles out there that explains the system. One of those that I used to understand is this Entity System for Javascript You will also see naming similarities in this library as I got inspired by it. If you want a general explanation then head over to Wikipedia
- Gives the most basic features to get going
- it's small (1.62kb minified)
- no dependencies
- it has documentation
- Because the philosophy of this library is to be lightweight and simple, I haven't found a solution yet to make rendering work in a intelligent manner (It would call the rendering processor multiple times per frame which is baaad), so for now use this only to update entities. However there are methods implemented to help you work inside your rendering function.
- TBD
In essence it works like this:
- You write components and processors and register them in the system.
- You compose Entities out of those components you just registered.
- You register those entities in the system.
- You call the libraries update function.
- It will magically update every entity with the corresponding processor.
Code examples TBD
- Implement a method that will freeze a processor and keep component state
- Solve the rendering problem