Implement MVC design pattern under cocos2d-x architecture

Implement MVC design pattern under cocos2d-x architecture
0.0 0


Bartek Wilczyński have already implemented MVC design pattern under cocos2d-iphone architecture. But no one has done same thing for cocos2d-x till now. After several days of studying & working, finally I made a shiny MVC frame under cocos2d-x. I have tested it and it worked fine, so I think I can use it on my next little game :slight_smile:

You can get source code under:

Since I’m a n00b of C++ and I just have one month of programming experience on it, I’m sure my codes have some problems and limitations. Just point it out, and help me to make it better. Hope some day it can be part of the engine :slight_smile:


Thanks for you contribution. You controller distribute the messages to models and views, very well designed.

Several years ago, I used to implement some projects in pure MVC architecture. But later I realize that MVC is not the silver bullet. In one hand, it’s not suitable for small-teams, in the other hand, if artist in your team didn’t take charge of “Views”, MVC architecture makes no sense to dev speed.
IMO, the real MVC is something like xcode vs. Interface Builder, cocos2d vs CocosBuilder, one for programmer and one for artist. Without a programmer, artist can complete all jobs about “View”.


“the real MVC” is just another brand new point of view for me. Technology should make people work more efficiently, and help people do jobs which they are good at. (You just can’t expect a programmer make UI as good as these designers, LOL)

In a programmer’s view, cocos2d should do the view part.


I have converted the cocos2d MVC pattern and implemented it in cocos2d-x
Just added an article here if you are still interested: