Cosmologicon on 2018/04/21 23:56
of Universe Factory 25
Let me know here if you encounter any bugs. Thanks!
(log in to comment)
The Component class is defined in a module I made called enco. It is documented, but to be honest, the basic idea is hard to get used to. If you do try it, let me know if you have any feedback!
print('class decorator is called :)')
b = B()
I think this style is quite fun, because use class modifies another class is easy to accept by noob like me, not instance modifies another class. In my eyes, this is normal, say the code maybe like
print('class decorator runing')
print('class decorator comming')
I think I need more practicing time, to be honest, ECS is really hard to me, say, I use kivy, there is a game engine called kivent based on kivy, but I can not use it, because it is using ECS. I even can not blit a image on screen, because it is using system! I think when I have a month free time, I would research it. Anyway, thank you for teaching me this, maybe several years later, I would get your idea of this ECS implementation. :)
I also think I should not have called it enco. The basic idea is something I came up with while learning the benefits of an entity-component system, so I called it that, but it's really not the same thing as an ECS.
Between these two concepts - decorators and ECS - I think I understand why this module has not caught on. But thanks for checking it out!
In my eyes, I think enco is fine, it is not hard to understand, just entity's component, creating every components for the entity, then use think method if it need update. This is somehow quite like sprite in pygame. this concept and usage is more easier than typical ECS's components. It is still object oriented programming.
I am shocked when I found you created such repo in github 3 years ago :) Only from the time and experience, I think you must be right in using decorators here. :)