Tag Info

New answers tagged

0

After using several entity-component systems, especially CraftyJS, I more or less got the answer to my question: yes, you can reuse components (especially sprites or images and mouse-click handlers in 2D games) for the GUI. Much of the time, you only have access to the ECS, and not the underlying systems (eg. drawing system). In this case, it's okay to use ...


1

That depends, like you pretty much said yourself, on how much change you are willing to make to your code base. I'll give you one suggestion I've used before and have liked. Some pseudocode: class Sprite { ... }; // You can have several instances of this one class World { SpriteList renderQueue; void DrawSprite(Sprite s) { ...



Top 50 recent answers are included