Bartek Wilczynski bio photo

Bartek Wilczynski

IT consultant and entrepreneur with over 10 years of experience in a variety of medium-size line of business applications, mostly in .NET technology.

Email Twitter LinkedIn Youtube

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:

  1. We implemented the Model which helps us encapsulate the logic of a game that is not polluted with other concerns (like display),
  2. We implemented the Controller that handles the user interaction (and updates the model),
  3. We implemented the View which responsibility is ONLY to display the current state of a model.
The interaction between the components is the following:
  1. The Controller starts the Model and the View,
  2. The View displays the Model,
  3. The View responds to user touches and passes (using delegate) the event to the Controller,
  4. The Controller implements view delegate and reacts by calling the Model,
  5. The Model performs some game logic and notifies the View that its state has changed,
  6. The View updates its objects (like sprites) according to the current state of the Model.
Open questions:
  1. If you were going to implement an "Undo" functionality using NSUndoManager, where would you put your undo calls?
  2. How would you store the state of your current scene?
  3. Others?