Skip to main content
Removing blacklisted engine tag.
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Positioning How can I position sprites in a Component-Entity engine?

I'm building my first component/entity engine and I'm not so sure about some of my choices. I'm here asking suggestions on my first doubt.

I draw objects with 2 different behaviours:

1) Position driven by Physics.

2) Position defined by other logics.

  1. Position driven by Physics.

  2. Position defined by other logics.

At the moment I've only built the first kind of object adding to some entities a Render component (which contains information about the sprite to draw) and a Physic component which contains body information. The Rendering system just attaches Render components sprites to the main view and the Physic System takes each entity that owns a Physic component and defines the sprite position for each entity.

Question 1)

Is it a valid choice to access (and modify) Sprites positions directly through the Physic System?

Question 2)

In your opinion, forFor the second type of object, should I manage the sprite position using a third component which is responsible only for that? Is

Is it a valid solution or I'm totally wrong?

I'm a bit confused about how to manage logicslogic and positions with this kind of system... It seems a bit overwhelming to create a component for every behaviour that I need to define.

Positioning sprites in a Component-Entity engine

I'm building my first component/entity engine and I'm not so sure about some of my choices. I'm here asking suggestions on my first doubt.

I draw objects with 2 different behaviours:

1) Position driven by Physics.

2) Position defined by other logics.

At the moment I've only built the first kind of object adding to some entities a Render component (which contains information about the sprite to draw) and a Physic component which contains body information. The Rendering system just attaches Render components sprites to the main view and the Physic System takes each entity that owns a Physic component and defines the sprite position for each entity.

Question 1)

Is it a valid choice to access (and modify) Sprites positions directly through the Physic System?

Question 2)

In your opinion, for the second type of object, should I manage the sprite position using a third component which is responsible only for that? Is it a valid solution or I'm totally wrong?

I'm a bit confused about how to manage logics and positions with this kind of system... It seems a bit overwhelming to create a component for every behaviour that I need to define.

How can I position sprites in a Component-Entity engine?

I'm building my first component/entity engine and I'm not so sure about some of my choices. I'm here asking suggestions on my first doubt.

I draw objects with 2 different behaviours:

  1. Position driven by Physics.

  2. Position defined by other logics.

At the moment I've only built the first kind of object adding to some entities a Render component (which contains information about the sprite to draw) and a Physic component which contains body information. The Rendering system just attaches Render components sprites to the main view and the Physic System takes each entity that owns a Physic component and defines the sprite position for each entity.

Question 1)

Is it a valid choice to access (and modify) Sprites positions directly through the Physic System?

Question 2)

For the second type of object, should I manage the sprite position using a third component which is responsible only for that?

Is it a valid solution or I'm totally wrong?

I'm a bit confused about how to manage logic and positions with this kind of system... It seems a bit overwhelming to create a component for every behaviour that I need to define.

Source Link
MatterGoal
  • 762
  • 1
  • 8
  • 13

Positioning sprites in a Component-Entity engine

I'm building my first component/entity engine and I'm not so sure about some of my choices. I'm here asking suggestions on my first doubt.

I draw objects with 2 different behaviours:

1) Position driven by Physics.

2) Position defined by other logics.

At the moment I've only built the first kind of object adding to some entities a Render component (which contains information about the sprite to draw) and a Physic component which contains body information. The Rendering system just attaches Render components sprites to the main view and the Physic System takes each entity that owns a Physic component and defines the sprite position for each entity.

Question 1)

Is it a valid choice to access (and modify) Sprites positions directly through the Physic System?

Question 2)

In your opinion, for the second type of object, should I manage the sprite position using a third component which is responsible only for that? Is it a valid solution or I'm totally wrong?

I'm a bit confused about how to manage logics and positions with this kind of system... It seems a bit overwhelming to create a component for every behaviour that I need to define.