What do you mean by “rate of bouncing” ? Would you like your ball to bounce for 10 seconds doing 10 “bounces”? If so, you already have code for a second-long bounce, all you’ve got to do is put it in a separate function and schedule it as a selector.
For example :
void bouncyBall() {
//code to bounce the ball one time
}
//Somewhere in your corresponding init method/class constructor:
schedule(schedule_selector(YourClassName::bouncyBall), <#float interval#>, <#unsigned int repeat#>, <#float delay#>));
//The rest of the parameters should be self-explanatory.
By `rate of bounce`, I mean the intensity level of the bouncing. The default bounce effect is too strong for me, I want to make a lighter bounce with a reduced number of bounces happening. By default, CCEaseBounceOut and CCEaseBounceOut makes the sprite bounce 4 or 5 times. Need to reduce it to 2.
I believe something should be done with CCEaseBounce::bounceTime, but I quite dont understand whats happening in that function
Well, maybe you could try to experiment with it like that :
CCEaseBounceOut *bounce = CCEaseBounceOut::create(CCMoveBy::create(1.0, ccp(0,c->screenHeight*0.25)));
bounce->setBounceTime(/*put different values here to check results*/);
tab->runAction(bounce);