MVC design in Cocoa games: Is it possible?

I'm working on creating games on OS X, using the Cocoa framework, the probably only and best way to utilize all the capabilities of this operating system. Since Cocoa is MVC, I have to frame my games around this style. Is there any problem with framing your game using a MVC design? What can I do to make game development easier or more efficient in Cocoa? To be particular, my method to creating games is displayed below: Game Views For each component in a game that can be rendered, I use a game view. For example in a 3D game with a GUI, a menu, etc., there would be a 3DView, GUIView, MenuView, etc. Game Model and Logic A game's data and logic are coupled together into separate objects that don't have much to do with Cocoa itself. For example, in a Tetris clone I made, there was a class for the Tetrimino object, with methods that affected itself and other objects, but not Cocoa. This applied to all other game objects. Global Game Objects The game views need certain data to render, and the game model needs to get its input from somewhere. So global objects are made that the model and view can both read and affect.

Mar 10, 2025 - 05:39
 0
MVC design in Cocoa games: Is it possible?

I'm working on creating games on OS X, using the Cocoa framework, the probably only and best way to utilize all the capabilities of this operating system. Since Cocoa is MVC, I have to frame my games around this style. Is there any problem with framing your game using a MVC design? What can I do to make game development easier or more efficient in Cocoa? To be particular, my method to creating games is displayed below:

Game Views

For each component in a game that can be rendered, I use a game view. For example in a 3D game with a GUI, a menu, etc., there would be a 3DView, GUIView, MenuView, etc.

Game Model and Logic

A game's data and logic are coupled together into separate objects that don't have much to do with Cocoa itself. For example, in a Tetris clone I made, there was a class for the Tetrimino object, with methods that affected itself and other objects, but not Cocoa. This applied to all other game objects.

Global Game Objects

The game views need certain data to render, and the game model needs to get its input from somewhere. So global objects are made that the model and view can both read and affect.