简体   繁体   中英

cocos2dx C++ CCShatteredTiles3D is slow

I am currently using cocos2dx C++ version 2.0.1 and I am trying to add a shatter effect to a sprite. When I run this code I do see the shatter effect but it slows my frame rate down tremendously.

CCActionInterval* shatteredTiles = CCShatteredTiles3D::create(20 ,false,ccg(10,10), .5f);

grid[3][3].color->runAction(shatteredTiles);

(by the way grid[3][3].color is just a ccsprite)

I go all the way from 60fps to 30 just from this code running. I wanted to do something like this on 16 different sprites all at once and that makes my code run at 3fps after that. What am I doing wrong I have been trying to fix this issue for a full day straight now. Any help would be highly appreciated thank you.

Is there any special reason for using deprecated version of cocos2dx ? Current version is 2.2.3 or 3.1. This could have been a bug in that build. I suggest updating to 2.2.3, it should take minimum effort. Also if you have some reason for 2.0.1, try seeing that effect in test-cpp project that came with that cocos2dx. Doing this will prove whether its cocos2dx issue or something at your end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM