I am new to cocos2d-x and I am developing a game in x-code using cocos2d-x.In my game i have a menu scene and game scene. In my game scene after adding the obstacles FPS is decreasing to 10 So my game performance is very low. Following is the code which i used to add obstacles in my game. and i have eight obstacles in my game. I created all the obstacles in one function and call that function by scheduler from init().Please help me solve this problem.
time = time + 1;
int i=arc4random()%9;
obs1 = CCSprite::create("obs1.png");
obs1->setPosition(ccp((winwsize/5)+(2*winwsize),winhsize/2.45));
this->addChild(obs1,1);
obs1->setVisible(true);
if(time%60==0&&i>=0&&i<=1)
{
CCActionInterval* act1=CCMoveTo::create(7.0,ccp(-50,winhsize/2.45));
obs1->runAction(CCRepeatForever::create(act1));
CCRotateBy *rot=CCRotateBy::create(13, -2000);
obs1->runAction(rot);
}