Regarding Object creating in Cocos2d-x


Why using static function to create Objects like scene, menu etc in cocos2d-x? Is it same in Cocos2d for iphone?
Will it cause problems if I use C
+ ways eg. ‘new’,‘delete’ to handle the objects? If static function is the only way or safe way to create those objects, I don’t think it is a good design because it breaks the flexibility of C
+ programing and increases the studying cost for cocos2dx.**


If you look into implementation of such static functions you should notice that it does create an object with ‘new’ then call some ‘init’ method and then autorelease created object if all goes fine. You can do all that stuff manually without calling static function if you want.