CCMutableArray is deprected in 2.0?

CCMutableArray is deprected in 2.0?
0.0 0


I’ve downloaded 2.0rc and coding in the HelloWorldScene.cpp,
but the Xcode shows me “use of undeclared identifier ‘CCMutableArray’”?

Unknown type name CCMutableArray

It’s migrated to CCArray.
CCArray only accept CCObject elements.


i’ve found it from ur official news.
thanks so much~


It is very comfortable to use CCArray - to write less symbols! But I have a question:
So, I had:

cocos2d::CCMutableArraycocos2d::CCSprite* *targets;
cocos2d::CCMutableArraycocos2d::CCSprite* *projectiles;

Now it will be:

cocos2d::CCArray *_targets; cocos2d::CCArray *_projectiles; cocos2d::CCArray *_snakes;

In the other words, any new class, I create must inherit from CCObject to be able to be used in CCArray. If CCArray is cross-platform, then I must ALLWAYS inherit from CCObject to write cross-platform apps, don’t I? And no aggregations? I’m new to cocos2d-x, please, answer.


[[Cocos2d-x v2.0 Migration Guide]], please refer to “Why CCMutableArray is deprecated?”
CCArray is used as the param of APIs in cocos2d-x. If you’re only to organize your data in game logic, but not pass into cocos2d APIs, you can still use std::vector or std::list as well.


Walzer Wang, Thank You very much!


Damn, have you ever thought about backward-compatitable before remove any function?

This is a common engine which are now used by many people. Supposed we develop a game based on 1.X version, than we upload the engine to 2.x version, it is found that many many code should be updated and adapted before the game could be executed successfully.

Some common code we designed for further usage in the games on plan, but now, we have to re-write them based on 2.x.

This is a very very bad user experience

Abel Lee wrote:

I’ve downloaded 2.0rc and coding in the HelloWorldScene.cpp,
but the Xcode shows me “use of undeclared identifier ‘CCMutableArray’”?


Yeah. Then go write your own engine and ask yourself about “backward compatibility” before each time you want to make its API more clearly and more convenient.

Those codes of yours can also be integrated into the 1.x version to form a new engine-branch, say, Zero-Point-Super-2D-Game-Engine. Why didn’t do that yourselves (I mean, you and your team)?

FYI I’m just a newbie here but don’t like the way you vomit the “Damn it”. You said this is a common engine but acted like it’s YOUR engine… :wink: