I want to learn how to develop a MVC pattern, but i can't find any site in where they focus it to Games and not to Browser / Windows calculator.
Would anyone please link me a tutorial of how to develop MVC patter for games?
Thank you very much
I want to learn how to develop a MVC pattern, but i can't find any site in where they focus it to Games and not to Browser / Windows calculator.
Would anyone please link me a tutorial of how to develop MVC patter for games?
Thank you very much
Take a look at Game Coding Complete. McShaffry makes use of the MVC architecture and explains its uses well.
The basic gist of it in terms of games is usually:
Model
This is your game logic. Game state changes, scripted events, rulesets, etc.
View
This is mainly the rendering aspect of the game. If you wanted to be cross-platform and support more graphics APIs, you'd just need to change the View portion of the game without touching any of the other code.
Controller
Pretty much what it sounds like. This section handles the input events that affect the game state (Model) and in turn what happens on screen (View). You can be a bit clever with this for AI, for example. You could have a PlayerController and an AIController that both send input events to the Model code.
Similarly, the View can be AI sensors in order to observe the environment to make decisions (a heavily subsidised version of the player's view).
Hope that helps.