Hello! I created a game example using the ECS (Entity Component System) architecture. It took several iterations, and now I want to share the result.
In case you missed my post in Community Challenge: Explosions, I’m sharing this as a separate forum thread.
The GitHub README contains several notes about how the game and architecture work. I followed these main rules for the project:
- Use the tiny-ecs library without modifications.
- Entities should be simple Lua tables without any special data.
- No external
require()
calls in systems to maintain portability between projects. - Components can only be modified within one system. For example,
entity.transform.position_x = 10
should only be changed in the transform system.
I think this might be interesting for programmers. If you have different approaches, ideas, or questions, let’s talk!
There are still some areas where it’s unclear how to do things the “correct” way (though in real games, we often cut corners because it’s faster and easier), such as event handling, debugging, and correct composing different systems, but I think this is a good start!
GitHub: https://github.com/Insality/shooting_circles
Play HTML: https://insality.github.io/shooting_circles