Recently I came across the idea of creating games using Components.
I searched and found this and read some gamedev posts.
What i understood is, there is a abstract GameObject class, which is basically the Component container. Every object in the game will inherit from just this class and implement its pure virtual Update() function. They can also add necessary components.
We also have a abstract Component class, every component inherits from it and implements its pure virtual Update() method. This method is called inside the GameObjects's Update() method?
First Qus: Am I right about what I said above? If wrong, where am I wrong?
Second Qus: Is there another way to do this? A better way?
After that, the components need to talk with each other, and the best way to do this is to use a messaging system.
Third Qus: But if the game is large enough, won't there be thousands of message types?
Fouth Qus: Let's say, we have a physics component, is it necessary that this component has to be same for all GameObjects? I mean the same class with same data and functionality?
Fifth Qus: Can GameObject's change component behaviour or attribute?
Sixth Qus: If the physics component is unique(or you can say that the ans of 4th qus is yes), then if i want some GameObject to have the gravity of 9.8 and others of 4.9, how can i accomplish that?
Thanks in advance.