This post is going to be short. If you have any questions regarding the previous parts or something is unclear please let me know. I have some contract projects going on (which going to be HUGE!!!) so not so much time for blogging. To wrap up the previous parts:
- We implemented the Model which helps us encapsulate the logic of a game that is not polluted with other concerns (like display),
- We implemented the Controller that handles the user interaction (and updates the model),
- We implemented the View which responsibility is ONLY to display the current state of a model.
The interaction between the components is the following:
- The Controller starts the Model and the View,
- The View displays the Model,
- The View responds to user touches and passes (using delegate) the event to the Controller,
- The Controller implements view delegate and reacts by calling the Model,
- The Model performs some game logic and notifies the View that its state has changed,
- The View updates its objects (like sprites) according to the current state of the Model.
Open questions:
- If you were going to implement an "Undo" functionality using NSUndoManager, where would you put your undo calls?
- How would you store the state of your current scene?
- Others?