Question about component based design: handling objects interaction

Posted by Milo on Game Development See other posts from Game Development or by Milo
Published on 2012-08-27T11:21:58Z Indexed on 2012/08/27 21:57 UTC
Read the original article Hit count: 315

Filed under:
|
|

I'm not sure how exactly objects do things to other objects in a component based design.

Say I have an Obj class. I do:

Obj obj;
obj.add(new Position());
obj.add(new Physics());

How could I then have another object not only move the ball but have those physics applied. I'm not looking for implementation details but rather abstractly how objects communicate. In an entity based design, you might just have:

obj1.emitForceOn(obj2,5.0,0.0,0.0);

Any article or explanation to get a better grasp on a component driven design and how to do basic things would be really helpful.

© Game Development or respective owner

Related posts about c++

Related posts about architecture