Hi every one!
GCC4 is a great book and I enjoyed reading it. I learned much, especially from the ideas about Process and Component. Thanks to Mike and Rez!
I'm now trying to write a simple 2D game and I come across some questions:
1.As we know, the visual representation of the game should be managed by Game View, while the Game Logic knows little (or nothing) about that. But many of the Actors do have RenderComponent or AudioComponent that contains data of the game representation. Do the components break the rule?
- If yes, should we move the data to somewhere else?
- If no, how to decide that what data should be in the component and what should not? What method should the components offer?
2. I'm going to use an engine (named cocos2d-x). The engine encapsulates the system related codes (which basically means that it offers the applications layer) and offers a class named Sprite. The class is used for displaying 2D elements. A common practice for novice is to inherit from the class and simply write any logic you want into it. I'm afraid that this approach may cause disaster in maintenance and I want to stick with the Application_GameLogic_GameView architecture described by the GCC4. How should I design the architecture and components so that:
- The Application_GameLogic_GameView and the Actor_Component architecture is applied properly
- Making use of some system of the engine (such as the Sprite class and the application-layer-like codes)
My English is poor and I may missed something in the book answering the questions. If it's the case, please tell me what chapters I should read again
Thank you very much!
GCC4 is a great book and I enjoyed reading it. I learned much, especially from the ideas about Process and Component. Thanks to Mike and Rez!
I'm now trying to write a simple 2D game and I come across some questions:
1.As we know, the visual representation of the game should be managed by Game View, while the Game Logic knows little (or nothing) about that. But many of the Actors do have RenderComponent or AudioComponent that contains data of the game representation. Do the components break the rule?
- If yes, should we move the data to somewhere else?
- If no, how to decide that what data should be in the component and what should not? What method should the components offer?
2. I'm going to use an engine (named cocos2d-x). The engine encapsulates the system related codes (which basically means that it offers the applications layer) and offers a class named Sprite. The class is used for displaying 2D elements. A common practice for novice is to inherit from the class and simply write any logic you want into it. I'm afraid that this approach may cause disaster in maintenance and I want to stick with the Application_GameLogic_GameView architecture described by the GCC4. How should I design the architecture and components so that:
- The Application_GameLogic_GameView and the Actor_Component architecture is applied properly
- Making use of some system of the engine (such as the Sprite class and the application-layer-like codes)
My English is poor and I may missed something in the book answering the questions. If it's the case, please tell me what chapters I should read again
Thank you very much!