Fast forwarding the gameplay
Well, this could be quite a complicated task to achieve based on the exact type of result you wish to achieve. If you have schedulers that you want to speed up, you'd have to adjust each of your scheduler's delays by scheduling them yet again (with the adjusted delay) on each of your nodes. Secondly, you would have to speed up each running animation on each of your game's entities, either by using CCSpeed
on each action or by using the same logic as the schedulers.
Fortunately, there is an unbelievably painless way to accomplish a fast-forward effect with Cocos2d-x, but it comes with a slight drawback. We can actually control the main scheduler's time scale. The main scheduler that resides within CCDirector
, the one that is responsible for scheduling each scheduler within the application (including the CCActionManager
), can have its speed controlled by a single function!
Let's just see how it's done:
CCDirector::sharedDirector()->getScheduler()->setTimeScale...