Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean SceneGraph and Entity Component API #89

Closed
5 tasks done
sriharshachilakapati opened this issue Feb 2, 2017 · 0 comments
Closed
5 tasks done

Clean SceneGraph and Entity Component API #89

sriharshachilakapati opened this issue Feb 2, 2017 · 0 comments
Assignees
Projects
Milestone

Comments

@sriharshachilakapati
Copy link
Owner

sriharshachilakapati commented Feb 2, 2017

The scene graph and the entity component system that is present is a hacky implementation, and needs some cleaning to be better. We mainly need to clean this so we can guarantee a scene life cycle.

  • Convert components from interfaces to abstract classes.
  • Hide all the children and component collections in Entity classes.
  • Add instantiation methods and destruction methods.
  • Give an ID to all entities and components, for easy debugging.
  • All entities should have a destroyed flag set by the destruction methods.

The life cycle of the component is as follows:

  • create(Entity): Called just after adding to the entity. Also receives the entity reference that it is attached to.
  • init(): Called before the first update if the component is newly added.
  • update(float): Standard update method of the component. Receives the delta time.
  • render(float): Standard render method of the component. Receives the delta time.
  • dispose(): Called when the entity is destroyed and the components are about to be deleted.

With this, we can guarantee the life cycle of components. The same also goes with the entities and scenes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.3.1
DONE
Development

No branches or pull requests

1 participant