Jump to content

  • Log In with Google      Sign In   
  • Create Account


Yet another entity/component system


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 The Communist Duck   Members   -  Reputation: 154

Like
0Likes
Like

Posted 20 May 2011 - 04:18 AM

Hi. I've fiddled around, and I thought of a decent component design with XNA. I've tried to avoid the built in GameComponent for the most part.

There are Components such as PhysicsComponent and RenderComponent which derive from Component. Each Entity contains a list of components (I don't see myself needing to query for a PhysicsComponent; I could just send it a message). Each Component may register to some system - e.g. the PhysicsSystem, or the graphicsSystem (I think these would be static; comment?)

The World derives from DrawableGameComponent, and calls Update on each entity (which calls it on each Component) and Render on the GraphicsSystem (which has the list of RenderComponents).

I don't see myself needing a hugely complex one.

Feedback on it?


Sponsor:

#2 Deran   Members   -  Reputation: 100

Like
0Likes
Like

Posted 22 May 2011 - 10:41 AM

Each Component may register to some system - e.g. the PhysicsSystem, or the graphicsSystem (I think these would be static; comment?)


You might find this useful: http://gameprogrammingpatterns.com/service-locator.html

That way the systems wont have to be static, you can just have one static class that locates them.

There's also some stuff about components on that site.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS