New answers tagged component-based
0
When to think if it, many entities have things in common (like, for example, enemies with collision and physics), plus behavior that's specific to only that one kind of entity. Do I need to create lots of systems that are only good for one kind of entity, and are not at all generic/reusable?
If you put together all your different entity designs, you'll ...
4
They should use the same movement component for both, if the movement component is velocity. However, the systems that modify the velocity will be different. The ball will use the physics component to bounce off the paddles and walls, where the paddles will use the mouse/keyboard input component to move. So the physics system will be modifying the movement ...
1
I do tiles collision in a dedicated TilesCollisionSystem where relevant objects register their TilesCollisionComponent.
The component contains a pointer to the geometry used for collisions. Some objects only register to the TilesCollisionSystem (some particles for example).
This way there is a dedicated system for tiles collision and it goes only through ...
3
What you describe is certainly a strange approach to a grid based game. Anyway, there's no way to optimally reference a particular range of your xyz cube of entities without a relational structure containing them such as a 3 dimensional grid array, or something like an octree. Otherwise you're stuck looping through all of them comparing their positions which ...
0
Assuming your tiles / enemies / items all share a common base class, I don't see why this wouldn't work with a 1 dimensional array. You simply call each element as normal, except now you lose the ability to reference a tile by it's position easily. However, you can still do this pretty easily with the xyz components you mentioned.
If they do not have a ...
Top 50 recent answers are included