Question about component based design: handling objects interaction
- by Milo
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.