This article will be brief. If you have any questions about how to implement MVC in the cocos2d-x in the previous articles, please tell me so that I can add more details. Here, I will briefly summarizeArticle:
1. We implemented the model, which can help us encapsulate the game logic, so that our focus is on the game logic, rather than other (such as rendering)
2. We implemented the Controller to process user interaction and update the Model accordingly.
3. We have implemented the view, and its responsibility is only to display the status of the model.
The interaction between the three is as follows:
4. The controller initializes the model and view.
5. View displays the model.
6. View is responsible for receiving user touch events and passing them to the Controller for processing.
7. The controller implements the view proxy and can operate the model.
8. The model executes some game logic processing and notifies the view of its state changes.
9 view updates all objects in the model based on the current state, such as genie.
Leave a few open questions:
10 if you want to use nsuodomanager to implement the "undo" function, where will you place this function? Model? Controller? View?
11. How do you save the status information of the current scenario?
12. Can you add other questions?
Reference Source: http://www.cnblogs.com/andyque/archive/2012/03/18/2390109.html